/* Authentication Pages Styling */

/* Legacy auth chrome (signup/reset) — not site-page--legal | --marketing | --sign-in */
body.auth-page:not(.site-page--legal):not(.site-page--marketing):not(.site-page--sign-in):not(.style-lab-page) {
    font-family: inherit;
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    background: linear-gradient(145deg, rgba(20, 40, 60, 0.95) 0%, rgba(20, 40, 60, 0.9) 35%, rgba(200, 220, 235, 0.88) 100%);
    color: var(--color-midnight);
    position: relative;
    overflow: hidden;
}

body.auth-page:not(.site-page--legal):not(.site-page--marketing):not(.site-page--sign-in)::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(600px at 15% 25%, rgba(230, 190, 120, 0.22), transparent 55%),
        radial-gradient(520px at 85% 12%, rgba(145, 160, 225, 0.2), transparent 60%),
        radial-gradient(640px at 50% 90%, rgba(99, 165, 165, 0.18), transparent 65%);
    mix-blend-mode: screen;
    opacity: 0.85;
    z-index: 0;
}

/* Auth wrapper and card */
.auth-wrapper {
    width: min(540px, 100%);
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 30px 55px rgba(20, 40, 60, 0.24);
    backdrop-filter: blur(20px);
    padding: 40px 48px;
}

.auth-logo {
    display: block;
    margin: 0 auto 24px;
    max-width: 160px;
    height: auto;
}

/* Auth header */
.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-header h1 {
    margin: 0 0 10px;
    font-size: 1.85rem;
    color: var(--color-midnight);
    letter-spacing: -0.01em;
}

.auth-subtitle {
    margin: 0;
    font-size: 1rem;
    color: rgba(20, 40, 60, 0.7);
}

/* Form groups - uses base.css .text-input for inputs */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: rgba(20, 40, 60, 0.85);
}

/* Message banners */
.message-banner {
    background: rgba(55, 110, 95, 0.12);
    border: 1px solid rgba(55, 110, 95, 0.32);
    color: #245c4c;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.message-banner p {
    margin: 0 0 10px;
}

.message-banner p:last-child {
    margin-bottom: 0;
}

/* Error messages */
.error-message {
    background: rgba(229, 83, 83, 0.1);
    border: 1px solid rgba(229, 83, 83, 0.35);
    color: #b02a37;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.error-message p {
    margin: 0;
}

.field-error {
    color: #b02a37;
    font-size: 0.9rem;
    margin-top: 6px;
}

.help-text {
    color: rgba(20, 40, 60, 0.7);
    font-size: 0.9rem;
    margin-top: 6px;
}

.message-banner--success {
    background: rgba(55, 110, 95, 0.12);
    border-color: rgba(55, 110, 95, 0.32);
    color: #245c4c;
}

.message-banner--warning {
    background: rgba(195, 160, 120, 0.14);
    border-color: rgba(195, 160, 120, 0.4);
    color: #6f4d2a;
}

/* Auth actions */
.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 24px;
}

.auth-actions-row {
    display: flex;
    gap: 14px;
    flex-direction: column;
}

/* Responsive */
@media (min-width: 480px) {
    .auth-actions-row {
        flex-direction: row;
    }
}

@media (max-width: 520px) {
    .auth-card {
        padding: 32px 26px;
    }

    .auth-header h1 {
        font-size: 1.6rem;
    }
}

/* Sign-in: static/css/auth_sign_in.css + portal_shell.css (.site-page--sign-in) */

/* Brand-aligned auth pages (create account, password reset) */
@font-face {
    font-family: "GT Alpina";
    src: url("../fonts/GT Alpina/GT-Alpina-Standard-Light.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

body.auth-page.auth-brand {
    background:
        radial-gradient(760px at 12% 8%, rgba(230, 190, 120, 0.18), transparent 62%),
        radial-gradient(720px at 88% 6%, rgba(100, 165, 165, 0.12), transparent 64%),
        linear-gradient(155deg, #c8dceb 0%, #dce8f1 45%, #fff8f0 100%);
}

body.auth-page.auth-brand::before {
    opacity: 0.35;
}

.auth-brand .auth-wrapper {
    width: min(560px, 100%);
    z-index: 2;
}

.create-account-page .auth-wrapper {
    width: min(640px, 100%);
}

.auth-brand .auth-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 248, 240, 0.9);
    border: 1px solid rgba(20, 40, 60, 0.12);
    border-radius: 24px;
    box-shadow: 0 24px 48px rgba(20, 40, 60, 0.14);
    backdrop-filter: blur(10px);
    padding: 44px 42px 40px;
}

.auth-brand .auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, #e6be78, #c3a078);
    opacity: 0.95;
}

.auth-brand .auth-logo {
    max-width: 172px;
    margin: 0 auto 22px;
}

.auth-brand .auth-header {
    margin-bottom: 30px;
}

.auth-brand .auth-header h1 {
    font-family: "GT Alpina", "Times New Roman", serif;
    font-weight: 300;
    font-size: 2.18rem;
    line-height: 1.08;
    letter-spacing: -0.015em;
}

.auth-brand .auth-subtitle {
    max-width: 36ch;
    margin: 0 auto;
    line-height: 1.42;
    color: rgba(20, 40, 60, 0.78);
}

.auth-brand .form-group {
    margin-bottom: 22px;
}

.auth-brand .form-group label {
    color: rgba(20, 40, 60, 0.9);
    font-size: 0.96rem;
    font-weight: 600;
    letter-spacing: 0.004em;
}

.auth-brand .text-input input,
.auth-brand .text-input select {
    border-radius: 14px;
    border: 1px solid rgba(20, 40, 60, 0.22);
    background: rgba(255, 255, 255, 0.94);
    padding: 14px 16px;
}

.auth-brand .text-input input:focus,
.auth-brand .text-input input:focus-visible,
.auth-brand .text-input select:focus,
.auth-brand .text-input select:focus-visible {
    border-color: var(--color-sapphire);
    box-shadow: 0 0 0 4px rgba(95, 125, 200, 0.16);
}

.auth-brand .auth-actions {
    margin-top: 30px;
}

.auth-brand .auth-actions .modal_button {
    border-radius: 14px;
    background: #14283c;
    border: 1px solid rgba(20, 40, 60, 0.08);
    box-shadow: 0 10px 20px rgba(20, 40, 60, 0.2);
}

.auth-brand .auth-actions .modal_button:hover,
.auth-brand .auth-actions .modal_button:focus-visible {
    background: #376e5f;
}

.auth-brand .auth-actions .modal_button.secondary {
    background: rgba(200, 220, 235, 0.34);
    border: 1px solid rgba(20, 40, 60, 0.16);
    color: var(--color-midnight);
    box-shadow: none;
}

.auth-brand .auth-actions .modal_button.secondary:hover,
.auth-brand .auth-actions .modal_button.secondary:focus-visible {
    background: rgba(200, 220, 235, 0.55);
}

.create-account-page .form-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.create-account-page .form-row .form-group {
    margin-bottom: 0;
    flex: 1;
}

.create-account-page .terms-consent {
    margin-top: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(20, 40, 60, 0.12);
    background: rgba(200, 220, 235, 0.28);
}

.create-account-page .terms-consent label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    font-weight: 500;
    font-size: 0.96rem;
    color: rgba(20, 40, 60, 0.82);
}

.create-account-page .terms-consent input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: var(--color-midnight);
}

.create-account-page .terms-consent a {
    color: var(--color-midnight);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(20, 40, 60, 0.22);
    transition: color 0.18s ease, border-color 0.18s ease;
}

.create-account-page .terms-consent a:hover,
.create-account-page .terms-consent a:focus-visible {
    color: var(--color-forest);
    border-color: rgba(55, 110, 95, 0.6);
}

@media (max-width: 560px) {
    .auth-brand .auth-card {
        padding: 36px 24px 30px;
    }

    .auth-brand .auth-header {
        margin-bottom: 24px;
    }

    .auth-brand .auth-header h1 {
        font-size: 1.92rem;
    }

    .create-account-page .form-row {
        flex-direction: column;
    }
}
