.profile-page {
    --profile-footer-clearance: var(--shell-footer-height, 56px);
    color: #f2f0e8;
    flex: 1 1 auto;
    min-height: 0;
}

.profile-shell {
    max-width: 1100px;
    margin: 0 auto;
}

.profile-auth-shell {
    max-width: 760px;
}

.profile-grid {
    --bs-gutter-y: 0.9rem;
}

.profile-panel {
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
        rgba(18, 18, 18, 0.78);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.profile-panel-body {
    height: 100%;
    padding: 0.9rem 0.95rem 0.95rem;
    gap: 0.75rem;
}

.profile-panel-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff7eb;
}

.profile-panel-copy {
    margin: 0.35rem 0 0;
    color: rgba(242, 240, 232, 0.68);
    font-size: 0.94rem;
}

.profile-auth-header {
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-auth-title {
    font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.profile-auth-copy {
    max-width: 54ch;
}

.profile-auth-meta {
    margin-top: 0.75rem;
    color: rgba(242, 240, 232, 0.72);
    font-size: 0.92rem;
}

.profile-auth-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin-left: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff7eb;
}

.profile-page .alert {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(18, 18, 18, 0.9);
    color: #f2f0e8;
}

.profile-page .btn-close {
    filter: invert(1) grayscale(1);
}

.auth-form {
    height: 100%;
    gap: 0.75rem;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem 0.8rem;
}

.profile-form-grid-equal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-form-section {
    display: grid;
    gap: 0.75rem;
    padding-top: 0.9rem;
    margin-top: 0.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-form-section:first-of-type {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
}

.profile-form-section-title {
    margin: 0;
    color: #fff7eb;
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.form-field {
    min-height: 0;
    margin-bottom: 0 !important;
}

.form-field-full {
    grid-column: 1 / -1;
}

.form-field-postal {
    grid-column: span 1;
}

.form-field-city {
    grid-column: span 1;
}

@media (min-width: 992px) {
    .profile-form-grid {
        grid-template-columns: minmax(96px, 0.65fr) minmax(280px, 1.35fr);
    }
}

.profile-page .form-label {
    margin-bottom: 0.25rem;
    color: rgba(242, 240, 232, 0.82);
    font-weight: 600;
    font-size: 0.92rem;
}

.profile-page .form-control,
.profile-page select.form-control,
.profile-page textarea.form-control {
    width: 100%;
    min-height: 40px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: #f2f0e8;
    padding: 0.55rem 0.75rem;
    box-shadow: none;
}

.profile-page .form-control:focus,
.profile-page select.form-control:focus,
.profile-page textarea.form-control:focus {
    outline: none;
    border-color: rgba(255, 238, 209, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 227, 180, 0.16);
    background: rgba(255, 255, 255, 0.1);
    color: #fff7eb;
}

.profile-page .form-control::placeholder {
    color: rgba(242, 240, 232, 0.62);
}

.profile-page .invalid-feedback {
    color: #ffb8ab;
}

.profile-page .password-guidance {
    margin-top: 0.7rem;
    padding: 0.8rem 0.9rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.profile-page .password-guidance-title {
    margin-left: 0;
    margin-bottom: 0.45rem;
    color: rgba(242, 240, 232, 0.8);
}

.profile-page .password-criteria {
    margin-left: 0;
}

.profile-submit {
    min-height: 42px;
    margin-top: auto !important;
    border-radius: 14px;
    font-weight: 700;
}

.profile-sync-toggle {
    padding-top: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#use_for_billing {
    width: 1rem !important;
    height: 1rem !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer;
    min-width: 1rem !important;
    flex-shrink: 0 !important;
    accent-color: #efd9b0;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.2rem;
}

.form-check-label {
    cursor: pointer;
    margin: 0 !important;
    font-size: 0.95rem;
    color: #f2f0e8;
}

.profile-sync-help {
    padding-left: 1.65rem;
    font-size: 0.84rem;
    color: rgba(242, 240, 232, 0.62);
}

.billing-checkbox-wrap {
    padding-bottom: 0.1rem;
}

.profile-auth-panel {
    max-width: 700px;
    margin: 0 auto;
}

.profile-auth-actions {
    flex-wrap: wrap;
}

.profile-auth-actions .btn {
    min-height: 42px;
    border-radius: 14px;
}

.profile-auth-actions .btn:not(.profile-submit) {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
}

.profile-auth-page .auth-form {
    margin-top: 0.35rem;
}

#billing_col[hidden] {
    display: none !important;
}

@media (max-width: 991.98px) {
    body.page-profile main {
        overflow: hidden;
    }

    .profile-page {
        height: 100%;
        max-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable both-edges;
        scrollbar-width: thin;
        scrollbar-color: rgba(242, 201, 76, 0.72) rgba(255, 255, 255, 0.08);
        scroll-padding-bottom: var(--profile-footer-clearance);
    }

    .profile-shell {
        padding-bottom: var(--profile-footer-clearance);
    }

    .profile-page::-webkit-scrollbar {
        width: 10px;
    }

    .profile-page::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.06);
        border-radius: 999px;
    }

    .profile-page::-webkit-scrollbar-thumb {
        background: rgba(242, 201, 76, 0.72);
        border-radius: 999px;
        border: 2px solid rgba(15, 13, 11, 0.9);
    }

    .profile-form-grid {
        grid-template-columns: 1fr;
    }

    .profile-panel-body {
        padding: 0.95rem;
    }
}
