/* ==========================================================================
   AI-DMOS — Login — Flagship Enterprise Design
   Split layout: abstract industrial visual (left) + glassmorphism sign-in
   panel (right). Vanilla CSS only — no Bootstrap, no Tailwind.
   Palette: deep graphite/navy base, blue accent only (#0EA5FF / #38BDF8).
   ========================================================================== */

:root {
    --navy-deep: #0B1020;
    --graphite: #111827;
    --graphite-2: #161f30;
    --blue: #0EA5FF;
    --blue-soft: #38BDF8;
    --white: #F8FAFC;
    --text: #E5EAF2;
    --text-muted: #93A2B8;
    --text-dim: #5B6B82;
    --panel-glass: rgba(17, 24, 39, 0.55);
    --panel-border: rgba(56, 189, 248, 0.22);
    --radius-lg: 28px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body.v2-login {
    background: var(--navy-deep);
    color: var(--text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* ---------------------------------------------------------------- shell / split layout */

.dmos-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.dmos-left {
    flex: 0 0 60%;
    max-width: 60%;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    /* Solid fallback color shows cleanly if the file below is missing —
       a CSS background-image never renders a broken-image glyph, it just
       falls through to background-color. No background-image right now
       (2026-08-18): a hand-built SVG scene was tried and rejected — plain
       navy until a real photo/asset is sourced. */
    background-color: #0B1020;
}

.dmos-right {
    flex: 0 0 40%;
    max-width: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: linear-gradient(180deg, #0D1424 0%, #0B1020 100%);
    position: relative;
}

.dmos-right::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.25), transparent 8%);
    pointer-events: none;
}

/* ---------------------------------------------------------------- left: real factory photograph overlays */

/* Dark navy overlay + subtle blue light overlay, combined in one layer. */
.factory-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(11, 16, 32, 0.35) 0%, rgba(11, 16, 32, 0.20) 45%, rgba(11, 16, 32, 0.75) 100%),
        radial-gradient(ellipse 900px 500px at 20% 15%, rgba(14, 165, 255, 0.14), transparent 60%),
        radial-gradient(ellipse 700px 500px at 85% 80%, rgba(56, 189, 248, 0.10), transparent 60%),
        rgba(11, 16, 32, 0.42);
}

/* Smooth fade from the factory photo into the right-side login panel. */
.factory-edge-fade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, transparent 55%, rgba(11, 16, 32, 0.55) 82%, rgba(11, 16, 32, 0.92) 100%);
    pointer-events: none;
}

/* ---------------------------------------------------------------- left: content */

.left-content {
    position: relative;
    z-index: 2;
    padding: 0 8% 0 9%;
    max-width: 640px;
    animation: fadeInUp 1s ease-out both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.brand-mark svg {
    width: 84px;
    height: 84px;
    animation: markGlow 5s ease-in-out infinite;
}

@keyframes markGlow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(14, 165, 255, 0.35)); }
    50%      { filter: drop-shadow(0 0 18px rgba(56, 189, 248, 0.65)); }
}

.brand-word {
    margin: 0;
    font-family: "Poppins", "Inter", sans-serif;
    font-weight: 800;
    font-size: clamp(38px, 4.2vw, 58px);
    letter-spacing: 0.01em;
    line-height: 1;
}

.brand-word .ai-part {
    background: linear-gradient(135deg, #38BDF8, #0EA5FF);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-word .brand-hyphen {
    color: var(--text-dim);
    font-weight: 300;
    margin: 0 2px;
}

.brand-word .dmos-part {
    background: linear-gradient(135deg, #FFFFFF, #C7D2E0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.left-kicker {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 22px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--blue-soft);
}

.kicker-dash {
    display: inline-block;
    width: 22px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--blue-soft), transparent);
    flex-shrink: 0;
}

.left-powered {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 28px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.left-powered strong {
    color: var(--blue-soft);
    font-weight: 700;
}

.powered-icon {
    width: 15px;
    height: 15px;
    opacity: 0.85;
}

.left-statement {
    margin: 0;
    max-width: 480px;
    font-size: clamp(18px, 1.6vw, 22px);
    font-weight: 400;
    line-height: 1.55;
    color: var(--text);
    letter-spacing: 0.002em;
}

.left-statement .hl {
    color: var(--blue-soft);
    font-weight: 600;
}


/* ---------------------------------------------------------------- right: glass panel */

.login-panel {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    padding: 44px 40px 36px;
    border-radius: var(--radius-lg);
    background: var(--panel-glass);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.02) inset,
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 30px 80px rgba(0, 0, 0, 0.45),
        0 0 60px rgba(14, 165, 255, 0.10);
    animation: panelIn 0.9s cubic-bezier(.2,.8,.2,1) both, panelBreathe 7s ease-in-out infinite 0.9s;
}

@keyframes panelIn {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes panelBreathe {
    0%, 100% { box-shadow: 0 0 0 1px rgba(255,255,255,0.02) inset, 0 1px 0 rgba(255,255,255,0.06) inset, 0 30px 80px rgba(0,0,0,0.45), 0 0 50px rgba(14,165,255,0.09); }
    50%      { box-shadow: 0 0 0 1px rgba(255,255,255,0.02) inset, 0 1px 0 rgba(255,255,255,0.06) inset, 0 30px 80px rgba(0,0,0,0.45), 0 0 76px rgba(14,165,255,0.16); }
}

.panel-heading {
    text-align: left;
    margin-bottom: 26px;
}

.secure-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    margin-bottom: 14px;
    color: var(--blue-soft);
    background: rgba(56, 189, 248, 0.10);
    border: 1px solid rgba(56, 189, 248, 0.25);
}
.secure-badge svg { width: 18px; height: 18px; }

.panel-heading h2 {
    margin: 0 0 6px;
    font-family: "Poppins", sans-serif;
    font-weight: 700;
    font-size: 26px;
    color: var(--white);
    letter-spacing: 0.01em;
}

.panel-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

.panel-divider {
    display: block;
    width: 46px;
    height: 2px;
    margin-top: 16px;
    background: linear-gradient(90deg, var(--blue), var(--blue-soft));
    border-radius: 2px;
}

/* ---------------------------------------------------------------- form fields */

.field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 20px 0 8px;
}

.field-group {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field-group:focus-within {
    border-color: rgba(56, 189, 248, 0.55);
    background: rgba(56, 189, 248, 0.05);
    box-shadow: 0 0 0 3px rgba(14, 165, 255, 0.12);
}

.f-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    color: var(--text-dim);
    flex-shrink: 0;
}
.f-icon svg { width: 18px; height: 18px; }

.field-group input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--white);
    font-size: 14.5px;
    font-family: inherit;
    padding: 13px 14px 13px 0;
}

.field-group input::placeholder { color: var(--text-dim); }

.field-toggle {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 8px 14px;
    display: flex;
    align-items: center;
}
.field-toggle svg { width: 18px; height: 18px; }
.field-toggle:hover { color: var(--blue-soft); }

.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 26px;
}

.remember-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}

.remember-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--blue);
    cursor: pointer;
}

.forgot-link {
    font-size: 13px;
    color: var(--blue-soft);
    font-weight: 500;
}
.forgot-link:hover { text-decoration: underline; }

.btn-login {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--blue), var(--blue-soft));
    color: #06121F;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(14, 165, 255, 0.30);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-login svg { width: 18px; height: 18px; }

.btn-login:hover {
    filter: brightness(1.06);
    box-shadow: 0 10px 30px rgba(14, 165, 255, 0.42);
    transform: translateY(-1px);
}
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.7; cursor: default; transform: none; }

.alert-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #fca5a5;
    font-size: 13.5px;
    margin-bottom: 18px;
}
.alert-box svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.trust-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 26px;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-dim);
}
.trust-line svg { width: 15px; height: 15px; color: var(--blue-soft); opacity: 0.8; }

.dmos-copyright {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    z-index: 3;
    text-align: center;
    font-size: 12px;
    color: var(--text-dim);
    opacity: 0.75;
    pointer-events: none;
}

/* ---------------------------------------------------------------- forgot password modal */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 8, 16, 0.65);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-overlay.is-open { opacity: 1; visibility: visible; }

.modal-box {
    width: min(420px, 90vw);
    background: var(--graphite-2);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    transform: translateY(10px);
    transition: transform 0.2s ease;
}
.modal-overlay.is-open .modal-box { transform: translateY(0); }

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.modal-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    font-family: "Poppins", sans-serif;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}
.modal-close svg { width: 18px; height: 18px; }
.modal-close:hover { color: var(--white); }

.modal-body-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0 0 22px;
}

.modal-ok { max-width: 160px; margin: 0 auto; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 980px) {
    .dmos-shell { flex-direction: column; }
    .dmos-left, .dmos-right {
        flex: 1 1 auto;
        max-width: 100%;
    }
    .dmos-left { min-height: 46vh; padding: 40px 0; background-position: 40% center; }
    .left-content { padding: 0 24px; }
    .left-statement { max-width: 100%; }
    .dmos-right { padding: 32px 20px 44px; }
}

@media (max-width: 560px) {
    .dmos-left { background-position: 32% center; }
}

@media (prefers-reduced-motion: reduce) {
    .brand-mark svg, .login-panel, .left-content {
        animation: none !important;
    }
}
