/* =================================================================
   CFMS Admin Panel — Login Page Styles
   Bootstrap 5 + Custom Black & White Theme
================================================================= */

/* Google Font loaded via HTML */
:root {
    --black:     #000000;
    --bg:        #080808;
    --surface-1: #111111;
    --surface-2: #1a1a1a;
    --surface-3: #222222;
    --border:    rgba(255,255,255,0.08);
    --border-md: rgba(255,255,255,0.15);
    --border-hi: rgba(255,255,255,0.30);
    --white:     #ffffff;
    --grey-1:    #e5e5e5;
    --grey-2:    #aaaaaa;
    --grey-3:    #666666;
    --success:   #22c55e;
    --error:     #ef4444;
}

/* ── Base ──────────────────────────────────────────────────────── */
html, body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--white);
    overflow-x: hidden;
}

/* ── Animated Background ───────────────────────────────────────── */
.bg-wrap {
    position: fixed; inset: 0; z-index: 0; overflow: hidden;
    pointer-events: none;
}
.bg-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg,rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}
.bg-orb {
    position: absolute; border-radius: 50%;
    filter: blur(100px);
    animation: drift 18s ease-in-out infinite;
}
.bg-orb-1 {
    width: 500px; height: 500px;
    background: rgba(255,255,255,0.04);
    top: -200px; left: -200px;
}
.bg-orb-2 {
    width: 400px; height: 400px;
    background: rgba(255,255,255,0.02);
    bottom: -150px; right: -100px;
    animation-delay: -9s;
}
@keyframes drift {
    0%,100% { transform: translate(0,0) scale(1); }
    33%      { transform: translate(60px,40px) scale(1.05); }
    66%      { transform: translate(-30px,70px) scale(0.97); }
}

/* ── Page layout ───────────────────────────────────────────────── */
.login-page {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px 16px;
}

/* ── Login Card ────────────────────────────────────────────────── */
.login-card {
    width: 100%; max-width: 440px;
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-md);
    border-radius: 20px;
    padding: 48px 40px;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 24px 64px rgba(0,0,0,0.6),
        0 0 80px rgba(255,255,255,0.03);
    animation: cardIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes cardIn {
    from { opacity:0; transform: translateY(24px) scale(0.97); }
    to   { opacity:1; transform: translateY(0) scale(1); }
}

/* ── Brand ─────────────────────────────────────────────────────── */
.brand-icon {
    width: 60px; height: 60px;
    background: var(--surface-3);
    border: 1px solid var(--border-hi);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 0 30px rgba(255,255,255,0.06);
}
.brand-icon svg { width: 28px; height: 28px; stroke: var(--white); fill: none; stroke-width: 2; }
.brand-title    { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; color: var(--white); }
.brand-sub      { font-size: 13px; color: var(--grey-2); margin-top: 4px; }

/* ── Step dots ─────────────────────────────────────────────────── */
.step-dots { display: flex; align-items: center; justify-content: center; gap: 8px; }
.step-dot {
    height: 4px; border-radius: 2px;
    background: var(--surface-3);
    transition: all 0.4s;
    width: 28px;
}
.step-dot.active { background: var(--white); width: 40px; }
.step-dot.done   { background: var(--grey-3); }

/* ── Form steps ────────────────────────────────────────────────── */
.form-step { display: none; animation: slideIn 0.35s ease both; }
.form-step.active { display: block; }
@keyframes slideIn {
    from { opacity:0; transform: translateX(16px); }
    to   { opacity:1; transform: translateX(0); }
}

/* ── Labels & Inputs ───────────────────────────────────────────── */
.field-label {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.7px; color: var(--grey-3); margin-bottom: 8px;
}
.input-group-custom { position: relative; }
.input-icon {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--grey-3); pointer-events: none;
    display: flex; align-items: center;
}
.input-icon svg { width: 15px; height: 15px; }
.form-control-dark {
    width: 100%;
    background: var(--surface-2) !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    padding: 13px 14px 13px 42px !important;
    font-size: 14px; font-weight: 500;
    color: var(--white) !important;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.form-control-dark:focus {
    border-color: var(--border-hi) !important;
    background: var(--surface-3) !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.06) !important;
    color: var(--white) !important;
}
.form-control-dark::placeholder { color: var(--grey-3); }

/* ── OTP Boxes ─────────────────────────────────────────────────── */
.otp-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}
.otp-box {
    width: 100%; height: 56px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: center;
    font-size: 22px; font-weight: 700;
    color: var(--white);
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    caret-color: var(--white);
    padding: 0;
}
.otp-box:focus {
    border-color: var(--border-hi);
    background: var(--surface-3);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.07);
}
.otp-box.filled { border-color: var(--grey-3); }

/* ── Countdown ─────────────────────────────────────────────────── */
.countdown-timer {
    font-size: 28px; font-weight: 800;
    color: var(--white); letter-spacing: 3px;
    font-variant-numeric: tabular-nums;
}
.countdown-timer.urgent { color: var(--error); }
.countdown-bar-track {
    height: 3px; background: var(--surface-3);
    border-radius: 2px; overflow: hidden;
}
.countdown-bar {
    height: 100%; background: var(--white);
    border-radius: 2px; transition: width 1s linear, background 1s;
}
.countdown-bar.urgent { background: var(--error); }
.countdown-label { font-size: 11px; color: var(--grey-3); text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn-primary-dark {
    width: 100%; padding: 13px;
    background: var(--white); color: var(--black);
    border: none; border-radius: 10px;
    font-size: 14px; font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    position: relative;
}
.btn-primary-dark:hover {
    background: var(--grey-1);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(255,255,255,0.12);
}
.btn-primary-dark:active { transform: translateY(0); }
.btn-primary-dark:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost-dark {
    width: 100%; padding: 11px;
    background: transparent; color: var(--grey-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px; font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.btn-ghost-dark:hover { color: var(--white); border-color: var(--border-md); background: rgba(255,255,255,0.02); }

/* Spinner */
.btn-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: var(--black);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}
.is-loading .btn-spinner  { display: block; }
.is-loading .btn-text     { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Alerts ────────────────────────────────────────────────────── */
.alert-dark {
    padding: 12px 14px; border-radius: 10px;
    font-size: 13px; font-weight: 500;
    display: none; align-items: flex-start; gap: 10px; line-height: 1.4;
}
.alert-dark.show  { display: flex; }
.alert-dark svg   { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-danger { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2); color: #86efac; }

/* ── Divider ───────────────────────────────────────────────────── */
.dark-divider { height: 1px; background: var(--border); }

/* ── Resend ────────────────────────────────────────────────────── */
.resend-link {
    background: none; border: none; cursor: pointer;
    color: var(--grey-1); font-weight: 500;
    font-family: 'Inter', sans-serif; font-size: 13px;
    text-decoration: underline; padding: 0;
}
.resend-link:disabled { color: var(--grey-3); cursor: not-allowed; text-decoration: none; }

/* ── Footer ────────────────────────────────────────────────────── */
.login-footer { font-size: 12px; color: var(--grey-3); }

/* ── Mobile responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
    .login-card { padding: 32px 20px; }
    .otp-box    { height: 48px; font-size: 18px; }
    .brand-title { font-size: 18px; }
}
