:root {
    --auth-bg: #f1f5f9;
    --auth-card: #ffffff;
    --auth-alt: #f8fafc;
    --auth-border: #e2e8f0;
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-primary: #2563eb;
    --auth-primary-soft: rgba(37, 99, 235, 0.1);
    --auth-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.dark-mode {
    --auth-bg: #0a0f1e;
    --auth-card: #141b2d;
    --auth-alt: #1a2336;
    --auth-border: #2a3650;
    --auth-text: #f1f5f9;
    --auth-muted: #94a3b8;
    --auth-primary: #60a5fa;
    --auth-primary-soft: rgba(96, 165, 250, 0.12);
    --auth-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.auth-page {
    min-height: calc(100vh - 106px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 16px 46px;
    background:
        radial-gradient(circle at 10% 10%, rgba(37, 99, 235, 0.1), transparent 35%),
        var(--auth-bg);
    font-family: 'Inter', 'Poppins', sans-serif;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(360px, 0.95fr) minmax(400px, 1.05fr);
    width: min(980px, 100%);
    min-height: 570px;
    overflow: hidden;
    border: 1px solid var(--auth-border);
    border-radius: 22px;
    background: var(--auth-card);
    box-shadow: var(--auth-shadow);
}

.auth-showcase {
    position: relative;
    overflow: hidden;
    padding: 44px 40px;
    background: linear-gradient(145deg, #0f172a 0%, #172554 55%, #2563eb 130%);
    color: #ffffff;
}

.auth-showcase::before,
.auth-showcase::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.auth-showcase::before {
    width: 360px;
    height: 360px;
    right: -190px;
    top: -120px;
}

.auth-showcase::after {
    width: 250px;
    height: 250px;
    left: -140px;
    bottom: -120px;
}

.auth-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 52px;
}

.auth-brand img {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.auth-brand-name {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-brand-name span {
    color: #93c5fd;
}

.auth-showcase h1 {
    position: relative;
    z-index: 1;
    max-width: 390px;
    margin: 0 0 14px;
    font-size: clamp(1.8rem, 3vw, 2.45rem);
    line-height: 1.12;
    letter-spacing: -0.04em;
}

.auth-showcase > p {
    position: relative;
    z-index: 1;
    max-width: 400px;
    margin: 0 0 28px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.9rem;
    line-height: 1.65;
}

.auth-benefits {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 13px;
}

.auth-benefit {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.82rem;
    font-weight: 500;
}

.auth-benefit-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 9px;
    background: rgba(147, 197, 253, 0.15);
    color: #bfdbfe;
}

.auth-showcase-footer {
    position: absolute;
    z-index: 1;
    right: 40px;
    bottom: 30px;
    left: 40px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.68rem;
}

.auth-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 44px 48px;
    background: var(--auth-card);
}

.auth-form-heading {
    margin-bottom: 28px;
}

.auth-form-heading h2 {
    margin: 0 0 7px;
    color: var(--auth-text);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-form-heading p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 0.84rem;
}

.auth-alert {
    padding: 10px 12px;
    margin-bottom: 18px;
    border: 1px solid rgba(220, 38, 38, 0.25);
    border-radius: 8px;
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    font-size: 0.78rem;
}

.auth-alert.validation-summary-valid {
    display: none;
}

.auth-field {
    margin-bottom: 18px;
}

.auth-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--auth-text);
    font-size: 0.76rem;
    font-weight: 700;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap > i {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 1;
    color: var(--auth-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.auth-input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1px solid var(--auth-border);
    border-radius: 9px;
    outline: none;
    background: var(--auth-alt) !important;
    color: var(--auth-text) !important;
    font: inherit;
    font-size: 0.86rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-autofill: none;
}

.auth-input::placeholder { color: var(--auth-muted); }

.auth-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px var(--auth-primary-soft);
    background: var(--auth-card) !important;
}

/* Fix browser autofill in dark mode */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--auth-text);
    -webkit-box-shadow: 0 0 0 1000px var(--auth-alt) inset;
    transition: background-color 5000s ease-in-out 0s;
}

.auth-field .text-danger {
    display: block;
    margin-top: 5px;
    font-size: 0.72rem;
}

.auth-submit {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--auth-primary), #1d4ed8);
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-submit:hover {
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 7px 16px rgba(37, 99, 235, 0.25);
}

.auth-register {
    padding-top: 22px;
    margin-top: 24px;
    border-top: 1px solid var(--auth-border);
    color: var(--auth-muted);
    text-align: center;
    font-size: 0.8rem;
}

.auth-register a {
    color: var(--auth-primary);
    font-weight: 700;
    text-decoration: none;
}

.auth-register a:hover { text-decoration: underline; }

.auth-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    color: var(--auth-muted);
    font-size: 0.7rem;
}

.auth-security i { color: var(--auth-positive, #16a34a); }

@media (max-width: 800px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-showcase { min-height: 330px; padding: 30px 28px; }
    .auth-brand { margin-bottom: 32px; }
    .auth-showcase-footer { position: static; right: auto; bottom: auto; left: auto; margin-top: 24px; }
    .auth-form-panel { padding: 34px 28px; }
}

@media (max-width: 480px) {
    .auth-page { padding: 16px 10px 30px; }
    .auth-shell { min-height: auto; border-radius: 16px; }
    .auth-showcase { min-height: auto; }
    .auth-showcase-footer { flex-direction: column; gap: 4px; }
    .auth-form-panel { padding: 30px 22px; }
}

/* --------------------------------------------------------------------------
   REGISTER PAGE — Additional styles
   -------------------------------------------------------------------------- */
.auth-shell.register-shell {
    grid-template-columns: minmax(340px, 0.88fr) minmax(420px, 1.12fr);
    min-height: 620px;
}

.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.auth-form-row .auth-field { margin-bottom: 14px; }

.auth-password-hint {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: -6px 0 14px;
}

.auth-password-hint .hint-chip {
    font-size: 0.64rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    background: var(--auth-alt);
    border: 1px solid var(--auth-border);
    color: var(--auth-muted);
    transition: all 0.2s ease;
}

.auth-password-hint .hint-chip.valid {
    background: rgba(22, 163, 74, 0.1);
    border-color: rgba(22, 163, 74, 0.3);
    color: #16a34a;
}

.dark-mode .auth-password-hint .hint-chip.valid {
    color: #4ade80;
}

.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 0.76rem;
    color: var(--auth-muted);
    line-height: 1.5;
}

.auth-terms input {
    margin-top: 3px;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    accent-color: var(--auth-primary);
    cursor: pointer;
}

.auth-terms a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-terms a:hover { text-decoration: underline; }

.auth-perks {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.auth-perk {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.78rem;
    font-weight: 500;
}

.auth-perk i {
    color: #93c5fd;
    font-size: 0.85rem;
    flex: 0 0 20px;
    text-align: center;
}

@media (max-width: 800px) {
    .auth-shell.register-shell { grid-template-columns: 1fr; }
    .auth-form-row { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 480px) {
    .auth-form-row { grid-template-columns: 1fr; }
}
