/* ==========================================================================
   Mash.Dispatch — Premium Login
   Split layout: left hero (dark indigo command-center + live radar) / right form
   Theme: dispatch & field operations control room
   ========================================================================== */

.dsp-login {
    min-height: 100vh;
    background: #0b1024;
    color: #0f172a;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ------- page layout ------- */
.dsp-login-shell {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    min-height: 100vh;
}
@media (max-width: 991.98px) {
    .dsp-login-shell { grid-template-columns: 1fr; }
}

/* ==========================================================================
   LEFT HERO — the command center
   ========================================================================== */
.dsp-login-hero {
    position: relative;
    overflow: hidden;
    padding: 3.5rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #e2e8f0;
    background:
        radial-gradient(1100px 600px at 12% -10%, rgba(79, 70, 229, 0.28), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(37, 99, 235, 0.22), transparent 60%),
        linear-gradient(135deg, #0b1024 0%, #161342 55%, #1b1248 100%);
}
@media (max-width: 991.98px) {
    .dsp-login-hero { display: none; }
}

/* soft grid overlay — control-room readout depth */
.dsp-login-hero::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(to right, rgba(148, 163, 184, 0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 35% 30%, black 35%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 35% 30%, black 35%, transparent 75%);
    pointer-events: none;
}

/* drifting aurora glow */
.dsp-login-hero::after {
    content: "";
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(500px 260px at 22% 38%, rgba(99, 102, 241, 0.25), transparent 60%),
        radial-gradient(420px 220px at 82% 70%, rgba(34, 211, 238, 0.20), transparent 60%);
    filter: blur(6px);
    animation: dsp-aurora 22s ease-in-out infinite;
    pointer-events: none;
}
@keyframes dsp-aurora {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(2%, -2%, 0) scale(1.04); }
}

/* ------ brand row ------ */
.dsp-hero-brand {
    position: relative; z-index: 2;
    display: flex; align-items: center; gap: 0.9rem;
}
.dsp-hero-brand .mark {
    width: 46px; height: 46px; border-radius: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: #fff;
    box-shadow: 0 10px 30px -10px rgba(37, 99, 235, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.dsp-hero-brand .wordmark strong {
    font-size: 1.2rem; letter-spacing: -0.01em; color: #f8fafc;
}
.dsp-hero-brand .wordmark small {
    display: block; color: #94a3b8; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.18em;
}

/* ==========================================================================
   CENTERPIECE — live dispatch radar
   ========================================================================== */
.dsp-hero-stage {
    position: relative; z-index: 2;
    flex-grow: 1;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem 0;
}

.dsp-radar {
    position: relative;
    width: min(420px, 70%);
    aspect-ratio: 1;
}

/* concentric range rings */
.dsp-radar-ring {
    position: absolute; inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.22);
}
.dsp-radar-ring.r2 { inset: 12%; border-style: solid; border-color: rgba(148, 163, 184, 0.16); }
.dsp-radar-ring.r3 { inset: 24%; border-style: dashed; border-color: rgba(99, 102, 241, 0.28); animation: dsp-spin 60s linear infinite; }

/* crosshair / grid lines through center, faded at the edges */
.dsp-radar-grid {
    position: absolute; inset: 0; border-radius: 50%;
    pointer-events: none;
    background:
        linear-gradient(to right, transparent calc(50% - 0.5px), rgba(148, 163, 184, 0.18) calc(50% - 0.5px), rgba(148, 163, 184, 0.18) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
        linear-gradient(to bottom, transparent calc(50% - 0.5px), rgba(148, 163, 184, 0.18) calc(50% - 0.5px), rgba(148, 163, 184, 0.18) calc(50% + 0.5px), transparent calc(50% + 0.5px));
    mask-image: radial-gradient(circle at center, black 55%, transparent 78%);
    -webkit-mask-image: radial-gradient(circle at center, black 55%, transparent 78%);
}
.dsp-radar-grid::before,
.dsp-radar-grid::after {
    content: "";
    position: absolute; inset: 0; border-radius: 50%;
}
/* diagonal cross lines */
.dsp-radar-grid::before {
    background:
        linear-gradient(45deg, transparent calc(50% - 0.5px), rgba(148, 163, 184, 0.10) calc(50% - 0.5px), rgba(148, 163, 184, 0.10) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
        linear-gradient(-45deg, transparent calc(50% - 0.5px), rgba(148, 163, 184, 0.10) calc(50% - 0.5px), rgba(148, 163, 184, 0.10) calc(50% + 0.5px), transparent calc(50% + 0.5px));
    mask-image: radial-gradient(circle at center, black 50%, transparent 72%);
    -webkit-mask-image: radial-gradient(circle at center, black 50%, transparent 72%);
}
/* mid range ring */
.dsp-radar-grid::after {
    inset: 36%;
    border: 1px solid rgba(148, 163, 184, 0.12);
}

/* THE signature radar sweep */
.dsp-radar-sweep {
    position: absolute; inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
        rgba(34, 211, 238, 0.35) 0deg,
        rgba(34, 211, 238, 0.12) 12deg,
        rgba(34, 211, 238, 0) 25%);
    mask-image: radial-gradient(circle at center, black 58%, transparent 60%);
    -webkit-mask-image: radial-gradient(circle at center, black 58%, transparent 60%);
    animation: dsp-sweep 6s linear infinite;
    pointer-events: none;
}
@keyframes dsp-sweep {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* center hub / base station */
.dsp-radar-core {
    position: absolute; inset: 36%;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #f8fafc; font-size: 1.4rem;
    background:
        radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.25), transparent 55%),
        linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    box-shadow:
        inset 0 0 22px rgba(34, 211, 238, 0.25),
        0 12px 40px -8px rgba(37, 99, 235, 0.7),
        0 0 0 1px rgba(99, 102, 241, 0.35);
    animation: dsp-core-pulse 3.4s ease-in-out infinite;
}
@keyframes dsp-core-pulse {
    0%, 100% { box-shadow: inset 0 0 22px rgba(34, 211, 238, 0.25), 0 12px 40px -8px rgba(37, 99, 235, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.35); }
    50%      { box-shadow: inset 0 0 30px rgba(34, 211, 238, 0.45), 0 16px 50px -8px rgba(37, 99, 235, 0.85), 0 0 0 1px rgba(99, 102, 241, 0.5); }
}

/* incoming-job pings */
.dsp-ping {
    position: absolute;
    width: 9px; height: 9px; border-radius: 50%;
    background: #22d3ee;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.6);
    animation: dsp-ping-ring 3s ease-out infinite;
}
.dsp-ping.p1 { top: 34%; left: 66%; animation-delay: 0s; }
.dsp-ping.p2 { top: 64%; left: 38%; background: #34d399; animation-delay: 1s; }
.dsp-ping.p3 { top: 58%; left: 70%; background: #818cf8; animation-delay: 2s; }
@keyframes dsp-ping-ring {
    0%   { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.55); }
    70%  { box-shadow: 0 0 0 26px rgba(34, 211, 238, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}
.dsp-ping.p2 { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
.dsp-ping.p3 { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.55); }

/* orbiting field-asset chips */
.dsp-orbit {
    position: absolute; inset: 0;
    animation: dsp-spin 26s linear infinite;
}
.dsp-orbit.orbit-2 { inset: 9%;  animation-duration: 36s; animation-direction: reverse; }
.dsp-orbit.orbit-3 { inset: 18%; animation-duration: 48s; }
.dsp-orbit .chip {
    position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #f8fafc; font-size: 1rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.95), rgba(67, 56, 202, 0.95));
    box-shadow: 0 12px 25px -10px rgba(79, 70, 229, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: dsp-counter-spin 26s linear infinite;
}
.dsp-orbit.orbit-2 .chip {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(29, 78, 216, 0.95));
    box-shadow: 0 12px 25px -10px rgba(37, 99, 235, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: dsp-counter-spin 36s linear infinite reverse;
}
.dsp-orbit.orbit-3 .chip {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.95), rgba(13, 148, 136, 0.95));
    box-shadow: 0 12px 25px -10px rgba(20, 184, 166, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: dsp-counter-spin 48s linear infinite;
}
@keyframes dsp-spin {
    from { transform: rotate(0deg); } to { transform: rotate(360deg); }
}
@keyframes dsp-counter-spin {
    from { transform: translateX(-50%) rotate(0deg); } to { transform: translateX(-50%) rotate(-360deg); }
}

/* floating KPI badges around the radar */
.dsp-stat {
    position: absolute;
    padding: 0.55rem 0.9rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #f1f5f9;
    font-size: 0.78rem;
    line-height: 1.1;
    min-width: 132px;
    box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.6);
    animation: dsp-float 6s ease-in-out infinite;
}
.dsp-stat .label {
    display: block; color: #94a3b8; font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 2px;
}
.dsp-stat .value { font-weight: 700; font-size: 0.95rem; color: #f8fafc; }
.dsp-stat .value .accent { color: #22d3ee; }
.dsp-stat .value .accent-success { color: #34d399; }

.dsp-stat.stat-1 { top: 10%;  left: -6%;  animation-delay: 0s; }
.dsp-stat.stat-2 { top: 20%;  right: -8%; animation-delay: 1.2s; }
.dsp-stat.stat-3 { bottom: 16%; left: -2%; animation-delay: 2.4s; }
.dsp-stat.stat-4 { bottom: 6%;  right: -4%; animation-delay: 3.6s; }

@keyframes dsp-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

/* ------ tagline above the features ------ */
.dsp-hero-tag {
    position: relative; z-index: 2;
    margin-bottom: 1.5rem;
}
.dsp-hero-tag .eyebrow {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.28);
    border-radius: 999px;
    color: #bfdbfe;
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600;
}
.dsp-hero-tag .eyebrow .dot {
    width: 6px; height: 6px; border-radius: 50%; background: #34d399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
    animation: dsp-live-dot 2s ease-out infinite;
}
@keyframes dsp-live-dot {
    0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.dsp-hero-tag h1 {
    font-size: 2.2rem; line-height: 1.15;
    color: #f8fafc;
    font-weight: 800; letter-spacing: -0.02em;
    margin: 0.9rem 0 0.4rem;
}
.dsp-hero-tag h1 .grad {
    background: linear-gradient(90deg, #22d3ee 0%, #818cf8 50%, #34d399 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dsp-hero-tag p {
    color: #94a3b8; font-size: 0.95rem; max-width: 460px; margin: 0;
}

/* ------ features panel beneath the radar ------ */
.dsp-hero-foot {
    position: relative; z-index: 2;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.dsp-feature {
    display: flex; align-items: flex-start; gap: 0.85rem;
    padding: 0.9rem 1rem;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.dsp-feature .fi {
    width: 34px; height: 34px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: #f8fafc; flex-shrink: 0;
}
.dsp-feature:nth-child(1) .fi { background: linear-gradient(135deg, #4f46e5, #4338ca); }
.dsp-feature:nth-child(2) .fi { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.dsp-feature:nth-child(3) .fi { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.dsp-feature:nth-child(4) .fi { background: linear-gradient(135deg, #f59e0b, #b45309); }
.dsp-feature h5 { font-size: 0.92rem; margin: 0 0 2px 0; color: #f8fafc; font-weight: 600; }
.dsp-feature p  { font-size: 0.78rem; margin: 0; color: #94a3b8; line-height: 1.45; }

/* ==========================================================================
   RIGHT FORM PANEL
   ========================================================================== */
.dsp-login-panel {
    display: flex; align-items: center; justify-content: center;
    padding: 3rem;
    background: #f8fafc;
    position: relative;
}
.dsp-login-panel::before {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(400px 260px at 100% 0%, rgba(37, 99, 235, 0.06), transparent 60%),
        radial-gradient(380px 240px at 0% 100%, rgba(79, 70, 229, 0.05), transparent 60%);
    pointer-events: none;
}

.dsp-login-card {
    position: relative; z-index: 1;
    width: 100%; max-width: 420px;
}

/* mobile-only mini brand so identity survives when the hero hides */
.dsp-login-mini-brand {
    display: none;
    align-items: center; gap: 0.6rem;
    margin-bottom: 2rem;
    color: #0f172a;
}
.dsp-login-mini-brand .mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.dsp-login-mini-brand strong { font-size: 1rem; }
@media (max-width: 991.98px) {
    .dsp-login-mini-brand { display: inline-flex; }
    .dsp-login-panel { min-height: 100vh; }
}

.dsp-login-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin: 0;
}
.dsp-login-sub {
    color: #64748b;
    margin-top: 0.35rem;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* form inputs */
.dsp-field {
    position: relative;
    margin-bottom: 1.1rem;
}
.dsp-field label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.dsp-field .wrap {
    position: relative;
}
.dsp-field .wrap i {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.05rem;
    pointer-events: none;
    transition: color .2s ease;
}
.dsp-field input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 44px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.95rem;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
    font-family: inherit;
}
.dsp-field input::placeholder { color: #cbd5e1; }
.dsp-field input:hover { border-color: #cbd5e1; }
.dsp-field input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
    background: #fff;
}
.dsp-field:focus-within i { color: #2563eb; }

/* password visibility toggle */
.dsp-field .toggle-password {
    position: absolute;
    right: 12px; top: 50%; transform: translateY(-50%);
    width: 30px; height: 30px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    border: 0; background: transparent;
    transition: color .2s ease, background .2s ease;
}
.dsp-field .toggle-password:hover { color: #0f172a; background: #f1f5f9; }

/* remember me + forgot row */
.dsp-login-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem;
}
.dsp-remember {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    user-select: none;
}
.dsp-remember input {
    width: 16px; height: 16px; accent-color: #2563eb;
}
.dsp-forgot {
    color: #2563eb; font-size: 0.85rem; text-decoration: none; font-weight: 600;
}
.dsp-forgot:hover { color: #4f46e5; text-decoration: underline; }

/* primary CTA */
.dsp-login-btn {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em;
    cursor: pointer;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    box-shadow: 0 18px 32px -14px rgba(37, 99, 235, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: transform .18s ease, box-shadow .25s ease, filter .18s ease;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.dsp-login-btn:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 22px 36px -14px rgba(37, 99, 235, 0.7); }
.dsp-login-btn:active { transform: translateY(0); }
.dsp-login-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.dsp-login-btn .spin {
    width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff; border-radius: 50%;
    animation: dsp-spin-btn 0.7s linear infinite;
    display: none;
}
.dsp-login-btn.is-loading .spin { display: inline-block; }
.dsp-login-btn.is-loading .label { display: none; }
@keyframes dsp-spin-btn { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* error alert */
.dsp-login-error {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.85rem;
    border-radius: 10px;
    display: none;
}
.dsp-login-error.is-shown { display: block; }

/* footer strip under the form */
.dsp-login-foot {
    margin-top: 2rem;
    display: flex; justify-content: space-between; align-items: center;
    color: #94a3b8;
    font-size: 0.75rem;
}
.dsp-login-foot a { color: #64748b; text-decoration: none; }
.dsp-login-foot a:hover { color: #0f172a; }
.dsp-login-foot .pill {
    padding: 0.2rem 0.55rem;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.05em;
    font-size: 0.68rem;
}

/* ==========================================================================
   Reduced motion respect
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .dsp-login-hero::after,
    .dsp-radar-ring.r3,
    .dsp-radar-sweep,
    .dsp-radar-core,
    .dsp-orbit, .dsp-orbit .chip,
    .dsp-ping, .dsp-stat,
    .dsp-hero-tag .eyebrow .dot,
    .dsp-login-btn .spin {
        animation: none !important;
    }
}
