/**
 * Sign in, register, forgot / reset password: the site's dark theme (tokens.css).
 * One rounded card under the fixed header: brand panel on the left, form on the right (form first on phones).
 * Loaded after Bootstrap, so these rules win over .form-control / .form-check-input at equal specificity.
 */
body {
    background: var(--color-bg) radial-gradient(circle at 50% 0%, rgba(55, 189, 138, 0.08) 0%, transparent 55%) no-repeat;
    color: var(--color-text-secondary);
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { color: var(--color-text); font-weight: var(--fw-semibold); letter-spacing: -0.02em; }
a { text-decoration: none; transition: var(--transition); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: var(--fw-medium);
    transition: var(--transition);
}

.btn-brand { border: 1px solid var(--color-primary); background: var(--color-primary); color: var(--color-on-primary); }
.btn-brand:hover, .btn-brand:focus-visible { border-color: var(--color-primary-hover); background: var(--color-primary-hover); color: var(--color-on-primary); box-shadow: var(--shadow-brand); }
.btn-brand:disabled { border-color: var(--color-primary); background: var(--color-primary); color: var(--color-on-primary); opacity: 0.75; }
.btn-outline-custom { border: 1px solid var(--color-border-strong); background: transparent; color: var(--color-text); }
.btn-outline-custom:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.05); color: var(--color-text); }

/* ---------- Card layout ---------- */
.auth-main { padding: clamp(110px, 12vw, 140px) var(--gutter) var(--space-section); }

.auth-main .split-login-wrapper {
    max-width: 1120px;
    min-height: 0;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
}

.brand-side {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 10%, rgba(55, 189, 138, 0.38), transparent 55%),
        radial-gradient(circle at 90% 100%, rgba(55, 189, 138, 0.18), transparent 50%),
        linear-gradient(160deg, #0b2419 0%, #050d09 100%);
    border-right: 1px solid var(--color-border);
}

.brand-pattern {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.brand-side .display-5 { font-size: clamp(2rem, 3.4vw, 2.75rem); line-height: 1.15; }
.auth-chip { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); }
.auth-chip span { font-size: var(--fs-sm); letter-spacing: 0.04em; }
.auth-stats { border-top: 1px solid rgba(255, 255, 255, 0.14); }

.form-side { background: var(--color-surface); }
.auth-title { color: var(--color-text); }
.auth-sub { margin: 0; color: var(--color-text-secondary); font-size: 1.05rem; }
.auth-muted { color: var(--color-text-secondary); font-size: 0.95rem; }
.auth-link { color: var(--color-primary); font-weight: var(--fw-semibold); }
.auth-link:hover { color: var(--color-focus); }

/* ---------- Fields ---------- */
.form-side .form-label { color: var(--color-text); }

.light-input {
    padding: 14px 22px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-pill);
    background-color: var(--color-surface-raised);
    color: var(--color-text);
    font-size: 0.95rem;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease), background-color var(--duration) var(--ease);
}

.light-input:focus {
    border-color: var(--color-primary);
    background-color: #181818;
    color: var(--color-text);
    box-shadow: 0 0 0 4px var(--color-primary-soft);
    outline: none;
}

.light-input::placeholder { color: var(--color-text-muted); }

/* browser autofill (saved email / password) keeps the dark field. !important: the fields also carry Bootstrap's
   .shadow-none (box-shadow: none !important), which used to win and leave the browser's white / light-blue fill */
.light-input:-webkit-autofill,
.light-input:-webkit-autofill:hover {
    -webkit-text-fill-color: var(--color-text) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--color-surface-raised) inset !important;
    box-shadow: 0 0 0 1000px var(--color-surface-raised) inset !important;
    caret-color: var(--color-text);
    transition: background-color 600000s 0s, color 600000s 0s;
}
.light-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--color-text) !important;
    -webkit-box-shadow: 0 0 0 1000px #181818 inset, 0 0 0 4px var(--color-primary-soft) !important;
    box-shadow: 0 0 0 1000px #181818 inset, 0 0 0 4px var(--color-primary-soft) !important;
}
.light-input:autofill {
    box-shadow: 0 0 0 1000px var(--color-surface-raised) inset !important;
    color: var(--color-text) !important;
}

.form-side .form-check-input { border-color: var(--color-border-strong); background-color: var(--color-surface-raised); cursor: pointer; }
.form-side .form-check-input:checked { border-color: var(--color-primary); background-color: var(--color-primary); }
.form-side .form-check-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 0.25rem var(--color-primary-soft); }
.form-side .form-check-label { color: var(--color-text-secondary); cursor: pointer; }

.password-icon-light {
    position: absolute;
    top: 50%;
    right: 20px;
    color: var(--color-text-muted);
    cursor: pointer;
    transform: translateY(-50%);
    transition: color var(--duration) var(--ease);
}

.password-icon-light:hover, .password-icon-light:focus-visible { color: var(--color-text); }

.back-link { padding-bottom: 2px; border-bottom: 1px solid transparent; color: var(--color-text-muted); }
.back-link:hover { border-color: var(--color-text-secondary); color: var(--color-text-secondary); }
.terms-link { color: var(--color-primary); font-weight: var(--fw-semibold); }
.terms-link:hover { color: var(--color-focus); }

.auth-alert { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-6); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: 0.9rem; }
.auth-alert--error { border: 1px solid rgba(248, 113, 113, 0.35); background: var(--color-error-soft); color: var(--color-error); }
.auth-alert--success { border: 1px solid rgba(52, 211, 153, 0.35); background: var(--color-success-soft); color: var(--color-success); }

/* ---------- Rotating quote + loading button ---------- */
.quote-rotator { position: relative; min-height: 80px; }
.quote-item { position: absolute; top: 0; left: 0; width: 100%; opacity: 0; transform: translateY(10px); transition: all 0.6s ease-in-out; pointer-events: none; }
.quote-item.active { opacity: 1; transform: translateY(0); }
.spinner-border-sm { width: 1rem; height: 1rem; border-width: 0.15em; }
.loading-text { display: none; }
.btn-loading .loading-text { display: inline-block; }
.btn-loading .normal-text { display: none; }

/* ---------- Tablet / phone: form first, then a short brand panel ---------- */
@media (max-width: 991.98px) {
    .brand-side { border-top: 1px solid var(--color-border); border-right: 0; }
    .brand-side .quote-rotator, .brand-side .auth-stats { display: none !important; }
    .brand-side p.fs-5 { margin-bottom: 0 !important; font-size: var(--fs-lg) !important; }
}

@media (max-width: 575.98px) {
    .auth-main { padding-right: 12px; padding-left: 12px; }
    .form-side .w-100.mx-auto { max-width: 100% !important; }
    .light-input { padding: 12px 18px; }
    .password-icon-light { right: 16px; }
    .btn { padding: 12px 18px; }
}
