/* ═══════════════════════════════════════════════════════════
   AIFI — Auth screens (login, OTP, forgot / reset password)
   Palette sampled from assets/images/empireone.png
   ═══════════════════════════════════════════════════════════ */

:root {
    --navy:       #080858;   /* EmpireOne wordmark navy   */
    --navy-deep:  #04042F;
    --violet:     #7838F8;   /* E1 mark / "CX" violet     */
    --blue:       #2060F8;   /* "One" blue                */
    --violet-soft:#8E7BFF;
    --brand-grad: linear-gradient(135deg, #7838F8 0%, #2060F8 100%);

    --text-dark:  #080858;
    --text-body:  #3E4670;
    --text-muted: #7C84A8;
    --line:       #E4E6F5;

    --danger:     #DC2626;
    --success:    #059669;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-body);
    background:
        radial-gradient(1100px 620px at 15% -8%,  rgba(120, 56, 248, .42) 0%, transparent 58%),
        radial-gradient(900px  560px at 92% 104%, rgba(32, 96, 248, .40) 0%, transparent 56%),
        radial-gradient(700px  520px at 78% 12%,  rgba(142, 123, 255, .18) 0%, transparent 60%),
        #04042F;
    overflow-x: hidden;
}

/* ── Animated backdrop ──────────────────────────────────── */
.auth-bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Canvas particle network (assets/js/particles.js) */
#particleCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Faint engineering grid, so the field reads as "vision system" */
.auth-grid {
    position: absolute;
    inset: -2px;
    background-image:
        linear-gradient(rgba(142, 123, 255, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(142, 123, 255, .055) 1px, transparent 1px);
    background-size: 62px 62px;
    mask-image: radial-gradient(ellipse 78% 68% at 50% 45%, #000 35%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 78% 68% at 50% 45%, #000 35%, transparent 100%);
}

.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(78px);
    opacity: .42;
    animation: orbDrift 26s ease-in-out infinite;
}
.orb-1 { width: 420px; height: 420px; top: -110px;  left: -90px;   background: #7838F8; }
.orb-2 { width: 340px; height: 340px; bottom: -90px; right: -70px; background: #2060F8; animation-duration: 31s; animation-delay: -7s; }
.orb-3 { width: 240px; height: 240px; top: 46%; right: 14%;        background: #8E7BFF; opacity: .26; animation-duration: 22s; animation-delay: -13s; }

@keyframes orbDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(48px, -36px) scale(1.1); }
    66%      { transform: translate(-34px, 32px) scale(.93); }
}

/* Slow scanning ring pair, echoing the bounding-box theme */
.tech-ring {
    position: absolute;
    top: 50%; left: 50%;
    border: 1px solid rgba(142, 123, 255, .13);
    border-radius: 50%;
    animation: ringSpin 60s linear infinite;
}
.ring-1 { width: 660px;  height: 660px;  margin: -330px 0 0 -330px; }
.ring-2 { width: 1000px; height: 1000px; margin: -500px 0 0 -500px; border-style: dashed; animation-duration: 96s; animation-direction: reverse; }

@keyframes ringSpin { to { transform: rotate(360deg); } }

/* ── Card ───────────────────────────────────────────────── */
.auth-center-wrap {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 44px 16px;
}

.auth-center-card {
    position: relative;
    width: 100%;
    max-width: 452px;
    padding: 0 0 24px;
    background: rgba(255, 255, 255, .975);
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 24px;
    box-shadow:
        0 36px 80px -22px rgba(2, 4, 26, .78),
        0 0 0 1px rgba(120, 56, 248, .06);
    overflow: hidden;
    animation: cardIn .55s cubic-bezier(.2, .9, .3, 1) both;
}

/* Brand gradient hairline along the top edge */
.auth-center-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--brand-grad);
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px) scale(.975); }
    to   { opacity: 1; transform: none; }
}

/* ── Logo band ──────────────────────────────────────────── */
.auth-logo-band {
    padding: 28px 34px 20px;
    text-align: center;
    border-bottom: 1px solid #F0F1FA;
    background: linear-gradient(180deg, #FBFBFF 0%, #FFFFFF 100%);
}

.auth-logo-band img {
    width: 186px;
    max-width: 68%;
    height: auto;
    display: block;
    margin: 0 auto 14px;
}

.auth-product-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(120, 56, 248, .1), rgba(32, 96, 248, .1));
    border: 1px solid rgba(120, 56, 248, .2);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #5B21C7;
}
.auth-product-tag strong { font-weight: 900; letter-spacing: 2.4px; }

/* ── Card body ──────────────────────────────────────────── */
.auth-card-body { padding: 24px 34px 0; }

.auth-heading { margin-bottom: 20px; text-align: center; }

.auth-card-title {
    margin: 0 0 6px;
    font-size: 23px;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -.5px;
}
.brand-highlight {
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.auth-card-sub {
    margin: 0;
    font-size: 13.4px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ── Alerts ─────────────────────────────────────────────── */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13.2px;
    font-weight: 600;
    text-align: left;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
}
.auth-alert.success { background: #ECFDF5; border-color: #A7F3D0; color: #047857; }
.auth-alert.info    { background: #EEF3FF; border-color: #C7D6FE; color: #1E40AF; }
.auth-alert i       { margin-top: 2px; flex-shrink: 0; }

/* ── Fields ─────────────────────────────────────────────── */
.auth-field { margin-bottom: 15px; }

.auth-field > label {
    display: block;
    margin-bottom: 7px;
    font-size: 12.4px;
    font-weight: 700;
    color: var(--text-dark);
}

.auth-input-wrap { position: relative; }

.field-icon {
    position: absolute;
    top: 50%; left: 15px;
    transform: translateY(-50%);
    font-size: 14px;
    color: #A6AECB;
    transition: color .18s;
    pointer-events: none;
}

.auth-input {
    width: 100%;
    height: 48px;
    padding: 0 44px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #FBFBFF;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-dark);
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.auth-input::placeholder { color: #AFB6CE; }
.auth-input:focus {
    border-color: var(--violet);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(120, 56, 248, .14);
}
.auth-input-wrap:focus-within .field-icon { color: var(--violet); }

.auth-toggle-pwd {
    position: absolute;
    top: 50%; right: 8px;
    transform: translateY(-50%);
    width: 34px; height: 34px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #9AA2C0;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.auth-toggle-pwd:hover { background: #F2F3FB; color: var(--violet); }

/* OTP code input */
.auth-input.otp-code {
    padding: 0 16px;
    text-align: center;
    font-size: 27px;
    font-weight: 800;
    letter-spacing: 13px;
    text-indent: 13px;
    color: var(--text-dark);
}
.auth-input.otp-code::placeholder { font-size: 15px; letter-spacing: 3px; font-weight: 600; }

.auth-extra-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 4px 0 18px;
}
.auth-forgot {
    font-size: 12.8px;
    font-weight: 700;
    color: var(--blue);
    text-decoration: none;
}
.auth-forgot:hover { text-decoration: underline; }

.auth-checkbox-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 2px 0 18px;
    font-size: 13px;
    color: var(--text-body);
}
.auth-checkbox { width: 16px; height: 16px; accent-color: var(--violet); cursor: pointer; }
.auth-checkbox-row label { cursor: pointer; }

/* ── Buttons ────────────────────────────────────────────── */
.auth-btn-primary {
    position: relative;
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: none;
    border-radius: 12px;
    background: var(--brand-grad);
    color: #fff;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: .2px;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 14px 28px -13px rgba(64, 72, 248, .95);
    transition: transform .15s, box-shadow .15s, opacity .15s;
}
.auth-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 20px 34px -15px rgba(64, 72, 248, 1);
}
.auth-btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Mid-submit state. Deliberately not `disabled` — that would drop the button's
   name=value from the POST body. */
.auth-btn-primary.is-submitting {
    opacity: .7;
    pointer-events: none;
    transform: none;
}

.auth-btn-ghost {
    width: 100%;
    height: 46px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text-body);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.auth-btn-ghost:hover:not(:disabled) { border-color: var(--violet); color: var(--violet); background: #FAF8FF; }
.auth-btn-ghost:disabled { opacity: .5; cursor: not-allowed; }

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
}
.auth-back-link:hover { color: var(--violet); }

/* ── OTP countdown ──────────────────────────────────────── */
.otp-timer-wrap { margin-bottom: 18px; }

.otp-timer-bar {
    height: 6px;
    border-radius: 20px;
    background: #EEEFF9;
    overflow: hidden;
}
.otp-timer-fill {
    height: 100%;
    border-radius: 20px;
    background: var(--brand-grad);
    transition: width 1s linear;
}
.otp-timer-text {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
}

/* ── Footer ─────────────────────────────────────────────── */
.auth-card-footer {
    margin: 20px 34px 0;
    padding-top: 15px;
    border-top: 1px solid #F0F1FA;
    text-align: center;
    font-size: 12px;
    color: #98A0BC;
}

@media (max-width: 520px) {
    .auth-center-card  { border-radius: 20px; }
    .auth-logo-band    { padding: 24px 22px 18px; }
    .auth-card-body    { padding: 20px 22px 0; }
    .auth-card-footer  { margin: 18px 22px 0; }
    .auth-card-title   { font-size: 20px; }
    .auth-input.otp-code { font-size: 22px; letter-spacing: 9px; text-indent: 9px; }
    .ring-1, .ring-2   { display: none; }
}
