/* Saksham Digital — auth pages (login, register, 2FA, force-password-reset).
 * Two-pane layout: dark warm-toned hero on the left, clean white form on the right.
 * Palette derives from the Saksham logo: red wordmark, blue tagline, and the
 * yellow/teal/green/red arrow rosette which we echo in the feature-card icons. */

:root {
    --sk-red:        #DC2626;
    --sk-red-dark:   #B91C1C;
    --sk-red-soft:   #FCA5A5;
    --sk-blue:       #3B82F6;
    --sk-yellow:     #F59E0B;
    --sk-teal:       #06B6D4;
    --sk-green:      #10B981;

    --auth-bg:       #14080B;
    --auth-bg-2:     #1F0E14;
    --auth-line:     rgba(220, 38, 38, 0.07);
    --auth-glow:     rgba(220, 38, 38, 0.22);
    --auth-text:     #F8EFEF;
    --auth-muted:    rgba(248, 239, 239, 0.55);
}

* { box-sizing: border-box }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: #f6f7fb;
    color: #1f2937;
    -webkit-font-smoothing: antialiased;
}

.auth-page {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* ── Hero (left pane) ───────────────────────────────────────────── */
.auth-hero {
    position: relative;
    background: linear-gradient(135deg, var(--auth-bg) 0%, var(--auth-bg-2) 100%);
    color: var(--auth-text);
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
.auth-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(115deg, transparent 49.5%, var(--auth-line) 49.5%, var(--auth-line) 50.2%, transparent 50.2%),
        linear-gradient(115deg, transparent 39.5%, var(--auth-line) 39.5%, var(--auth-line) 40.2%, transparent 40.2%),
        linear-gradient(115deg, transparent 64.5%, var(--auth-line) 64.5%, var(--auth-line) 65.2%, transparent 65.2%);
    pointer-events: none;
}
.auth-hero::after {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--auth-glow), transparent 70%);
    top: -180px;
    right: -140px;
    pointer-events: none;
}
.auth-hero > * { position: relative; z-index: 1 }

.auth-brand { display: flex; align-items: center; gap: 14px }
.auth-brand img {
    height: 120px;
    width: auto;
    max-width: 100%;
    background: none;
    padding: 0;
    object-fit: contain;
    /* Soft glow lifts the logo off the dark hero without putting it on a panel */
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .35));
}
/* The logo art already contains the SAKSHAM wordmark, so the adjacent text
   span is redundant — hide it visually but keep it in the DOM so screen
   readers and crawlers still pick up the brand name. */
.auth-brand-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-eyebrow {
    margin: 0 0 14px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .2em;
    color: var(--sk-red-soft);
    text-transform: uppercase;
}
.auth-headline {
    font-size: 2.6rem;
    line-height: 1.1;
    font-weight: 800;
    margin: 0 0 18px;
    letter-spacing: -.02em;
}
.auth-headline em { font-style: normal; color: var(--sk-red-soft); }
.auth-sub {
    font-size: 1rem;
    line-height: 1.55;
    color: var(--auth-muted);
    max-width: 30rem;
    margin: 0 0 40px;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 32rem;
}
.auth-feature {
    display: flex;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    transition: background .2s, transform .2s;
}
.auth-feature:hover { background: rgba(255, 255, 255, 0.06); transform: translateX(2px) }
.auth-feature-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-feature-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.75;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.auth-feature-icon.icon-yellow { background: rgba(245, 158, 11, .14); color: var(--sk-yellow) }
.auth-feature-icon.icon-teal   { background: rgba(6, 182, 212, .14); color: var(--sk-teal) }
.auth-feature-icon.icon-green  { background: rgba(16, 185, 129, .14); color: var(--sk-green) }
.auth-feature-icon.icon-red    { background: rgba(220, 38, 38, .14); color: var(--sk-red-soft) }

.auth-feature-title { font-weight: 700; font-size: .96rem; margin-bottom: 2px }
.auth-feature-desc { font-size: .82rem; color: var(--auth-muted); line-height: 1.45 }

.auth-hero-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    color: var(--auth-muted);
}
.auth-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sk-green);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .15);
}

/* ── Form pane (right) ─────────────────────────────────────────── */
.auth-pane {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: #fff;
}
.auth-form-card { width: 100%; max-width: 440px }
.auth-form-title {
    font-size: 1.85rem;
    font-weight: 800;
    margin: 0 0 6px;
    letter-spacing: -.01em;
    color: #111827;
}
.auth-form-sub {
    margin: 0 0 28px;
    color: #6b7280;
    font-size: .95rem;
}

.form-label {
    display: block;
    margin-bottom: .4rem;
    font-size: .78rem;
    font-weight: 600;
    color: #374151;
    letter-spacing: .01em;
}
.input-group { display: flex; width: 100%; position: relative }
.input-group-text {
    display: flex;
    align-items: center;
    padding: .7rem .9rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-right: 0;
    border-radius: 10px 0 0 10px;
    color: #6b7280;
    font-size: .85rem;
    font-weight: 600;
}
.form-control, .form-select, .form-textarea {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: .7rem .9rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: .95rem;
    transition: border-color .15s, box-shadow .15s;
}
.form-textarea { min-height: auto }
.form-control:focus, .form-select:focus, .form-textarea:focus {
    outline: 0;
    border-color: var(--sk-red);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, .12);
}
.input-group > .form-control,
.input-group > .form-select { border-radius: 0 10px 10px 0 }
.input-group > .form-control:not(:last-child) { border-radius: 0 }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: .75rem 1rem;
    font: inherit;
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, transform .05s, box-shadow .15s;
}
.btn:active { transform: translateY(1px) }
.btn-primary {
    background: var(--sk-red);
    border-color: var(--sk-red);
    color: #fff;
    width: 100%;
    min-height: 48px;
    box-shadow: 0 4px 14px rgba(220, 38, 38, .25);
}
.btn-primary:hover { background: var(--sk-red-dark); border-color: var(--sk-red-dark) }
.btn-primary:disabled, .btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none }
.btn-outline-secondary {
    background: #fff;
    border-color: #e5e7eb;
    color: #6b7280;
    border-radius: 0 10px 10px 0;
    font-size: .85rem;
    padding-left: 1rem;
    padding-right: 1rem;
}
.btn-outline-secondary:hover { background: #f9fafb }

.alert {
    position: relative;
    padding: .85rem 2.5rem .85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: .875rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fee2e2 }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #dcfce7 }
.btn-close {
    position: absolute;
    right: .7rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: .7;
    padding: 0 .35rem;
}
.btn-close:hover { opacity: 1 }
.btn-close::before { content: "\00d7" }

.auth-icon { font-style: normal; font-weight: 700 }
.auth-meta { margin-top: 18px; text-align: center; font-size: .8rem; color: #6b7280 }
.auth-meta a { color: var(--sk-red); text-decoration: none; font-weight: 700 }
.auth-meta a:hover { text-decoration: underline }

.auth-signup-row {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.auth-signup-row a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .65rem .8rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #374151;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: background .15s, border-color .15s, color .15s;
}
.auth-signup-row a:hover { background: #fef2f2; border-color: var(--sk-red-soft); color: var(--sk-red-dark) }

/* OTP-style large code input (used on verify_2fa) */
.auth-otp {
    text-align: center;
    font-size: 1.7rem;
    letter-spacing: .35em;
    font-weight: 700;
    min-height: 60px;
}
.form-text { display: block; margin-top: .35rem; font-size: .8rem; color: #6b7280; text-align: center }

/* Utilities reused inside the form pane */
.mb-3 { margin-bottom: 1.05rem } .mb-4 { margin-bottom: 1.5rem } .mb-0 { margin-bottom: 0 }
.mb-1 { margin-bottom: .25rem } .mt-3 { margin-top: 1rem } .text-center { text-align: center }
.text-muted { color: #6b7280 } .small { font-size: .86rem } .fw-semibold { font-weight: 600 }
.w-100 { width: 100% } .me-1 { margin-right: .25rem }
.row { display: grid; gap: 12px }
.row.cols-2 { grid-template-columns: 1fr 1fr }

.role-pills { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.role-pills label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .8rem .6rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: .9rem;
    color: #374151;
    transition: all .15s;
}
.role-pills input[type=radio] { display: none }
.role-pills input[type=radio]:checked + label {
    background: #fef2f2;
    border-color: var(--sk-red);
    color: var(--sk-red-dark);
    box-shadow: inset 0 0 0 1px var(--sk-red);
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .auth-page { grid-template-columns: 1fr }
    .auth-hero { padding: 36px 28px; min-height: auto }
    .auth-hero::after { display: none }
    .auth-brand img { height: 84px }
    .auth-headline { font-size: 1.8rem }
    .auth-sub { margin-bottom: 24px }
    .auth-features { display: none }
    .auth-hero-bottom { margin-top: 24px }
    .auth-pane { padding: 36px 24px }
}
@media (max-width: 575.98px) {
    .auth-hero { padding: 28px 22px }
    .auth-brand img { height: 68px }
    .auth-headline { font-size: 1.55rem }
    .auth-form-title { font-size: 1.5rem }
    .auth-signup-row { grid-template-columns: 1fr }
    .row.cols-2 { grid-template-columns: 1fr }
}
