/* Login & Register pages */
.page-auth {
    background: var(--background-color, #F4EEE8);
    min-height: 100vh;
}

.auth-page {
    max-width: 440px;
    margin: 0 auto;
    padding: 20px 16px 32px;
}

@media (max-width: 991.98px) {
    body.page-auth.has-mobile-nav .auth-page {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }
}

.auth-page--register {
    max-width: 560px;
}

/* ── Login full-screen ── */
body.page-auth--login-full {
    background: #0e0b14;
}

.auth-login-full {
    position: relative;
    min-height: 100dvh;
    overflow: hidden;
}

.auth-login-full-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
}

.auth-login-full-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.auth-login-full-scrim {
    position: fixed;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(8, 6, 14, 0.35) 0%, rgba(8, 6, 14, 0.15) 38%, rgba(8, 6, 14, 0.82) 100%),
        linear-gradient(0deg, rgba(8, 6, 14, 0.55), rgba(8, 6, 14, 0.55));
    pointer-events: none;
}

.auth-login-full-content {
    position: relative;
    z-index: 2;
    min-height: 100dvh;
    max-width: 420px;
    margin: 0 auto;
    padding: calc(20px + env(safe-area-inset-top, 0px)) 18px calc(88px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
}

.auth-login-full-head {
    padding-top: 8px;
}

.auth-login-kicker {
    margin: 0 0 10px;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(232, 180, 212, 0.78);
}

.auth-login-full-head h1 {
    margin: 0 0 10px;
    font-size: clamp(1.85rem, 7vw, 2.15rem);
    font-weight: 700;
    line-height: 1.2;
    color: #f6f0ea;
    letter-spacing: 0.02em;
}

.auth-login-full-head p {
    margin: 0;
    max-width: 18em;
    font-size: 0.92rem;
    line-height: 1.6;
    color: rgba(246, 240, 234, 0.72);
}

.auth-login-panel {
    padding: 22px 18px 20px;
    border-radius: 18px;
    background: rgba(14, 11, 20, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.auth-login-alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    font-size: 0.84rem;
    border-radius: 10px;
}

.auth-login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.auth-field-label {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: rgba(246, 240, 234, 0.62);
}

.auth-field-input {
    width: 100%;
    padding: 13px 0 11px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0;
    background: transparent;
    color: #f6f0ea;
    font-size: 1rem;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s ease;
}

.auth-field-input::placeholder {
    color: rgba(246, 240, 234, 0.28);
}

.auth-field-input:focus {
    border-bottom-color: rgba(232, 180, 212, 0.72);
}

.auth-field-input:-webkit-autofill,
.auth-field-input:-webkit-autofill:hover,
.auth-field-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgba(14, 11, 20, 0.95) inset !important;
    -webkit-text-fill-color: #f6f0ea !important;
    caret-color: #f6f0ea;
    border-bottom: 1px solid rgba(232, 180, 212, 0.45) !important;
    transition: background-color 99999s ease-out;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 2px 0 4px;
    font-size: 0.8rem;
    color: rgba(246, 240, 234, 0.55);
    cursor: pointer;
    user-select: none;
}

.auth-remember input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #8b5cf6;
    cursor: pointer;
}

.auth-login-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 4px;
}

.auth-login-submit {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    background: #f6f0ea;
    color: #1a1524;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.auth-login-submit:hover,
.auth-login-submit:focus {
    background: #fff;
    transform: translateY(-1px);
}

.auth-login-register {
    display: block;
    text-align: center;
    font-size: 0.84rem;
    color: rgba(246, 240, 234, 0.62);
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-login-register:hover,
.auth-login-register:focus {
    color: #e8b4d4;
    text-decoration: underline;
}

html.display-light .auth-login-full-scrim {
    background:
        linear-gradient(180deg, rgba(42, 27, 61, 0.28) 0%, rgba(42, 27, 61, 0.12) 40%, rgba(42, 27, 61, 0.78) 100%),
        linear-gradient(0deg, rgba(42, 27, 61, 0.35), rgba(42, 27, 61, 0.35));
}

html.display-light .auth-login-panel {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(42, 27, 61, 0.1);
}

html.display-light .auth-field-label {
    color: rgba(42, 27, 61, 0.62);
}

html.display-light .auth-field-input {
    color: #2a1b3d;
    border-bottom-color: rgba(42, 27, 61, 0.18);
}

html.display-light .auth-field-input:focus {
    border-bottom-color: rgba(124, 58, 237, 0.55);
}

html.display-light .auth-remember {
    color: rgba(42, 27, 61, 0.58);
}

html.display-light .auth-login-submit {
    background: #2a1b3d;
    color: #fff;
}

html.display-light .auth-login-register {
    color: #6d28d9;
}

.auth-hero {
    text-align: center;
    margin-bottom: 18px;
}

.auth-hero-art {
    width: min(280px, 78vw);
    height: auto;
    margin: 0 auto 12px;
    display: block;
    filter: drop-shadow(0 10px 24px rgba(124, 58, 237, 0.12));
}

.auth-hero--register .auth-hero-art {
    width: 100%;
    max-width: 360px;
    border-radius: 20px;
}

.auth-hero h1 {
    margin: 0 0 6px;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--dark-color, #2A1B3D);
    letter-spacing: 0.02em;
}

.auth-hero p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--muted-color, rgba(42, 27, 61, 0.68));
}

.auth-card {
    background: var(--card-bg, #fff);
    border-radius: 22px;
    border: 1px solid var(--surface-border, rgba(42, 27, 61, 0.1));
    box-shadow: 0 14px 36px rgba(42, 27, 61, 0.08);
    padding: 22px 18px 20px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--btn-primary-gradient, linear-gradient(135deg, #C084FC, #E879A9));
}

.auth-card-title {
    margin: 0 0 18px;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark-color, #2A1B3D);
}

.auth-card-title i {
    color: #C0266B;
    margin-right: 4px;
}

.auth-page .form-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--dark-color, #2A1B3D);
    margin-bottom: 6px;
}

.auth-page .form-control,
.auth-page .form-select {
    border-radius: 14px;
    border: 1px solid var(--surface-border, rgba(42, 27, 61, 0.14));
    background: #fff;
    color: var(--dark-color, #2A1B3D);
    padding: 11px 14px;
    box-shadow: none;
}

.auth-page .form-control:focus,
.auth-page .form-select:focus {
    border-color: #C084FC;
    box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.18);
    background: #fff;
    color: var(--dark-color, #2A1B3D);
}

.auth-page .form-control:-webkit-autofill,
.auth-page .form-control:-webkit-autofill:hover,
.auth-page .form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    -webkit-text-fill-color: #2A1B3D !important;
    caret-color: #2A1B3D;
    border: 1px solid rgba(192, 132, 252, 0.35);
}

.auth-page .form-text {
    color: var(--muted-color, rgba(42, 27, 61, 0.55));
    font-size: 0.78rem;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.auth-page .btn-voice {
    width: 100%;
    border-radius: 999px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    background: var(--btn-secondary-gradient, linear-gradient(135deg, #7C3AED, #DB2777));
    color: #fff;
    box-shadow: 0 8px 22px rgba(219, 39, 119, 0.22);
}

.auth-page .btn-voice:hover,
.auth-page .btn-voice:focus {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(219, 39, 119, 0.28);
}

.btn-auth-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-radius: 999px;
    padding: 11px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    color: #7C3AED;
    background: #fff;
    border: 2px solid rgba(124, 58, 237, 0.28);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-auth-outline:hover,
.btn-auth-outline:focus {
    color: #6D28D9;
    background: #f5f3ff;
    border-color: rgba(124, 58, 237, 0.45);
    transform: translateY(-1px);
    text-decoration: none;
}

.auth-perks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.auth-perk {
    background: #fff;
    border: 1px solid rgba(42, 27, 61, 0.08);
    border-radius: 14px;
    padding: 10px 6px;
    text-align: center;
    box-shadow: 0 6px 16px rgba(42, 27, 61, 0.05);
}

.auth-perk-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 6px;
    display: block;
}

.auth-perk strong {
    display: block;
    font-size: 0.72rem;
    line-height: 1.25;
    color: var(--dark-color, #2A1B3D);
}

.auth-avatar-box {
    text-align: center;
    padding: 14px;
    margin-bottom: 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(243, 232, 255, 0.65), rgba(252, 231, 243, 0.35));
    border: 1px dashed rgba(124, 58, 237, 0.22);
}

.auth-avatar-preview {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.18);
    margin-bottom: 10px;
}

.auth-avatar-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #C084FC;
    font-size: 2rem;
    border: 2px solid rgba(192, 132, 252, 0.25);
}

.auth-file-btn {
    position: relative;
    display: inline-block;
}

.auth-file-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.auth-file-btn label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #7C3AED;
    background: #fff;
    border: 1px solid rgba(124, 58, 237, 0.25);
    cursor: pointer;
}

.auth-switch-link {
    text-align: center;
    margin-top: 4px;
}

/* Hide old layout pieces on auth pages */
.page-auth .modern-container > .modern-header,
.page-auth .modern-container > .matching-card:not(.auth-card) {
    display: none;
}

html.display-dark .page-auth,
html:not(.display-light) .page-auth {
    background: #0E0B14;
}

html.display-dark .auth-hero h1,
html:not(.display-light) .auth-hero h1,
html.display-dark .auth-card-title,
html:not(.display-light) .auth-card-title,
html.display-dark .auth-page .form-label,
html:not(.display-light) .auth-page .form-label {
    color: #F6F0EA;
}

html.display-dark .auth-hero p,
html:not(.display-light) .auth-hero p,
html.display-dark .auth-page .form-text,
html:not(.display-light) .auth-page .form-text {
    color: rgba(246, 240, 234, 0.62);
}

html.display-dark .auth-card,
html:not(.display-light) .auth-card,
html.display-dark .auth-perk,
html:not(.display-light) .auth-perk {
    background: #1A1524;
    border-color: rgba(255, 255, 255, 0.08);
}

html.display-dark .auth-page .form-control,
html:not(.display-light) .auth-page .form-control,
html.display-dark .auth-page .form-select,
html:not(.display-light) .auth-page .form-select {
    background: #120e1a;
    border-color: rgba(255, 255, 255, 0.1);
    color: #F6F0EA;
}

html.display-dark .auth-page .form-control:-webkit-autofill,
html:not(.display-light) .auth-page .form-control:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #120e1a inset !important;
    -webkit-text-fill-color: #F6F0EA !important;
}

html.display-dark .btn-auth-outline,
html:not(.display-light) .btn-auth-outline {
    background: transparent;
    color: #E9D5FF;
    border-color: rgba(233, 213, 255, 0.35);
}

html.display-dark .btn-auth-outline:hover,
html:not(.display-light) .btn-auth-outline:hover {
    background: rgba(124, 58, 237, 0.15);
    color: #fff;
}

html.display-dark .auth-avatar-box,
html:not(.display-light) .auth-avatar-box {
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.12), rgba(219, 39, 119, 0.08));
    border-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 420px) {
    .auth-perks {
        grid-template-columns: 1fr;
    }

    .auth-perk {
        display: flex;
        align-items: center;
        gap: 10px;
        text-align: left;
        padding: 10px 12px;
    }

    .auth-perk-icon {
        margin: 0;
        flex-shrink: 0;
    }
}
