/* Account screens: the reference's quiet sunrise, open space and purple accents.
   Kept separate from the chat styles so this refresh cannot alter the chat UI. */
body.auth-scene {
    display: block;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f9f8fc;
    color: #252640;
}

.auth-landscape {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: url('/static/images/auth-sunrise.jpg') center 52% / cover no-repeat;
}

.auth-landscape::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(250, 249, 253, .89);
}

.auth-scene .auth-container {
    width: 100%;
    max-width: 460px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: max(24px, env(safe-area-inset-top)) 28px max(30px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0 0 30px -12px;
    flex-shrink: 0;
    color: #51438e;
    border-radius: 50%;
}
.auth-back:hover { background: rgba(81, 67, 154, .06); }

.auth-scene .auth-title {
    color: #24253f;
    font-size: clamp(29px, 7.5vw, 34px);
    line-height: 1.2;
    font-weight: 500;
    text-align: left;
    letter-spacing: -.035em;
    margin-bottom: 10px;
}

.auth-scene .auth-subtitle {
    color: #626582;
    font-size: 18px;
    line-height: 1.45;
    text-align: left;
    margin: 0 0 48px;
}

.auth-scene .auth-form { gap: 16px; }
.auth-input-wrap { position: relative; }
.auth-scene .form-group input {
    width: 100%;
    min-height: 56px;
    padding: 16px 48px;
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
    border: 1px solid #dbdbe8;
    border-radius: 15px;
    background: rgba(255, 255, 255, .40);
    color: #252640;
}
.auth-scene .form-group input::placeholder { color: #6e7088; opacity: 1; }
.auth-scene .form-group input:focus {
    border-color: #66569f;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 0 0 3px rgba(81, 67, 154, .10);
}
.auth-field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #4b4a72;
    pointer-events: none;
    z-index: 1;
}
.auth-password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #565579;
    cursor: pointer;
}
.auth-password-toggle:hover { background: rgba(81, 67, 154, .05); }
.auth-eye-slash { display: none; }
[aria-pressed="true"] .auth-eye-slash { display: block; }

.auth-scene .btn-primary,
.auth-btn-secondary {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 56px;
    padding: 14px 20px;
    border-radius: 16px;
    font: inherit;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 400;
    text-decoration: none;
    text-align: center;
    touch-action: manipulation;
}
.auth-scene .btn-primary {
    margin-top: 22px;
    color: #fff;
    background: #55488f;
    border: 1px solid #55488f;
}
.auth-scene .btn-primary:hover { background: #463a7d; }
.auth-btn-secondary {
    color: #423477;
    background: rgba(255, 255, 255, .36);
    border: 1px solid #a5a0c0;
}
.auth-btn-secondary:hover { background: rgba(255, 255, 255, .65); }

.auth-scene .auth-forgot-link {
    text-align: left;
    font-size: 15px;
    margin: -2px 0 2px;
}
.auth-scene .auth-forgot-link a { font-weight: 400; }
.auth-scene .auth-link {
    margin: auto 0 0;
    padding-top: 56px;
    color: #626582;
    font-size: 14px;
    line-height: 1.6;
}
.auth-scene .auth-link a { font-weight: 500; white-space: nowrap; margin-left: 5px; }
.auth-help { color: #626582; font-size: 13px; margin-top: -4px; }
.auth-scene .forgot-title { text-align: left; font-weight: 500; font-size: 22px; }
.auth-scene .forgot-desc { text-align: left; font-size: 15px; margin-bottom: 24px; }
.auth-scene .forgot-section .auth-forgot-link { margin-top: 24px; }
.auth-scene .error-msg { text-align: left; }
.auth-scene .success-msg { color: #226c43 !important; }
.auth-scene :is(a, button):focus-visible { outline: 3px solid #7565b0; outline-offset: 4px; }
.auth-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Welcome is the full landscape; the forms use a soft, readable wash. */
.auth-welcome .auth-landscape::after { background: linear-gradient(transparent 58%, rgba(251, 249, 250, .7)); }
.auth-welcome .auth-container { max-width: 460px; }
.auth-welcome-heading { margin: clamp(95px, 18vh, 190px) 20px 32px; }
.auth-welcome-heading h1 {
    color: #504486;
    font-weight: 400;
    font-size: 44px;
    line-height: 1.2;
    letter-spacing: -.035em;
    margin-bottom: 10px;
}
.auth-welcome-heading p { color: #505977; font-size: 23px; line-height: 1.4; letter-spacing: -.02em; }
.auth-welcome-actions { margin-top: auto; padding: 100px 0 36px; display: grid; gap: 16px; }
.auth-welcome-actions .btn-primary { margin-top: 0; }

@media (min-width: 1000px) {
    .auth-landscape { right: 38%; background-position: center 52%; }
    .auth-landscape::after { background: linear-gradient(90deg, transparent 50%, #f9f8fc 100%); }
    .auth-scene:not(.auth-welcome) .auth-container {
        margin-left: auto;
        margin-right: max(6vw, calc((100vw - 1400px) / 2));
        padding-top: max(38px, calc((100dvh - 700px) / 2));
        padding-bottom: max(38px, calc((100dvh - 700px) / 2));
    }
    .auth-welcome .auth-landscape { right: 0; background-size: 100% auto; background-position: center 52%; }
    .auth-welcome .auth-landscape::after {
        background: linear-gradient(90deg, rgba(250, 249, 252, .58), rgba(250, 249, 252, .32) 40%, transparent 75%);
    }
    .auth-welcome .auth-container { margin-left: 10vw; margin-right: auto; }
    .auth-welcome-heading { margin-left: 0; }
    .auth-welcome-heading h1 { font-size: 56px; }
    .auth-welcome-heading p { font-size: 25px; }
}

@media (max-height: 700px) {
    .auth-back { margin-bottom: 16px; }
    .auth-scene .auth-subtitle { margin-bottom: 28px; }
    .auth-scene .auth-link { padding-top: 30px; }
    .auth-welcome-heading { margin-top: 70px; }
    .auth-welcome-actions { padding-top: 60px; padding-bottom: 12px; }
}
