:root {
    box-sizing: border-box; color-scheme: dark;
    --bg: #0b101c; --panel: #0f1626; --line: #232c3f; --text: #eef1f7;
    --muted: #9aa4b8; --dim: #667089; --amber: #f59e0b; --amber-ink: #0b101c; --danger: #e5775a;
    --serif: "Fraunces", Georgia, "Times New Roman", serif;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: inherit; }
html { min-width: 320px; background: var(--bg); scroll-padding-top: env(safe-area-inset-top, 0); }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
#fx { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.login-layout { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.15fr 1fr; }

.brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 48px 56px; border-right: 1px solid var(--line); background: radial-gradient(120% 90% at 20% 110%, rgba(245,158,11,.09), transparent 55%); }
.brand-panel::before { content: ""; position: absolute; left: -12%; bottom: -25%; width: 75%; aspect-ratio: 1; background: radial-gradient(circle, rgba(245,158,11,.18), transparent 65%); animation: drift 14s ease-in-out infinite alternate; }
.territory-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.contours { animation: sway 20s ease-in-out infinite alternate; }
.brand-header, .brand-message, .route-map, .brand-footer { position: relative; z-index: 1; }
.brand-header, .mobile-brand { display: flex; align-items: center; gap: 14px; }
.brand-logo-image { display: block; width: 150px; height: auto; object-fit: contain; filter: drop-shadow(0 5px 9px rgba(0,0,0,.28)); transform-origin: 50% 100%; animation: truck-arrival 1.05s cubic-bezier(.2,.78,.2,1) both; }
.brand-divider { align-self: stretch; width: 1px; min-height: 56px; background: linear-gradient(transparent, rgba(238,241,247,.28) 18%, rgba(238,241,247,.28) 82%, transparent); transform-origin: center; animation: divider-arrival .45s .56s ease-out both; }
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-copy strong { color: var(--text); font: 500 26px/1.05 var(--serif); letter-spacing: -.01em; }
.brand-word { display: flex; white-space: nowrap; }
.brand-letter { display: inline-block; animation: letter-arrival .46s cubic-bezier(.2,.78,.2,1) both; animation-delay: calc(.64s + var(--letter-index) * 48ms); }
.brand-copy small { max-width: 190px; margin-top: 7px; color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.2; letter-spacing: .15em; text-transform: uppercase; animation: tagline-arrival .55s 1.24s ease-out both; }
.brand-message { max-width: 520px; margin-top: 24px; }
.brand-message h1 { margin: 0 0 20px; font: 500 clamp(32px,3.6vw,52px)/1.04 var(--serif); letter-spacing: -.02em; }
.brand-message h1 em { color: var(--amber); font-style: italic; }
.brand-message p { max-width: 430px; margin: 0; color: var(--muted); font-size: 16px; }
.route-map { flex: 1; min-height: 150px; margin: 28px 0 24px; }
.route-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.route-pulse { transform-box: fill-box; transform-origin: center; animation: route-pulse 2.8s ease-out infinite; }
.brand-footer { display: flex; gap: 36px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.brand-footer strong, .brand-footer span { display: block; }
.brand-footer strong { color: var(--text); font-size: 14px; font-weight: 500; }

.access-panel { display: flex; align-items: center; justify-content: center; padding: 48px 32px; background: rgba(15,22,38,.88); }
.access-content { width: 100%; max-width: 380px; }
.mobile-brand { display: none; margin-bottom: 36px; }
.mobile-brand .brand-logo-image { width: 132px; }
.access-heading h2 { margin: 0 0 6px; font: 500 30px/1.2 var(--serif); letter-spacing: -.01em; }
.access-heading p { margin: 0 0 32px; color: var(--muted); }
.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 8px; color: #d5dbe8; font-size: 13px; font-weight: 500; }
.input-wrap { position: relative; }
.field input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; outline: none; background: var(--bg); color: var(--text); transition: border-color .15s, box-shadow .15s; }
.field input::placeholder { color: var(--dim); opacity: 1; }
.field input:hover { border-color: #34405a; }
.field input:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.password-field input { padding-right: 92px; }
.password-toggle { position: absolute; top: 6px; right: 6px; height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 13px; }
.password-toggle:hover { color: var(--text); }
.caps-warning { display: none; margin-top: 6px; color: var(--amber); font-size: 12px; }
.caps-warning.is-visible { display: block; }
.form-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 26px; font-size: 13px; }
.remember { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-weight: 400; cursor: pointer; }
.remember input { width: 16px; height: 16px; margin: 0; accent-color: var(--amber); }
.text-button { padding: 0; border: 0; border-bottom: 1px solid transparent; background: none; color: var(--muted); font-size: 13px; text-decoration: none; }
.text-button:hover { color: var(--text); border-color: var(--amber); }
.submit-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 46px; padding: 0 20px; border: 0; border-radius: 8px; background: var(--amber); color: var(--amber-ink); font-weight: 600; font-size: 15px; transition: background .15s, transform .05s; }
.submit-button:hover { background: #fbb22e; }
.submit-button:active { transform: translateY(1px); }
.submit-button:disabled { cursor: default; opacity: .8; }
.submit-button:focus-visible, .password-toggle:focus-visible, .text-button:focus-visible, input[type="checkbox"]:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(11,16,28,.3); border-top-color: var(--amber-ink); border-radius: 50%; animation: spin .7s linear infinite; }
.login-alert { margin: -10px 0 22px; padding: 11px 13px; border: 1px solid rgba(229,119,90,.38); border-radius: 8px; background: rgba(229,119,90,.08); color: #ffb8a6; font-size: 13px; overflow-wrap: anywhere; }
.access-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12.5px; }
dialog { width: min(400px, calc(100% - 40px)); padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.45); }
dialog::backdrop { background: rgba(4,7,13,.72); }
dialog h2 { margin: 0 0 12px; font: 500 27px/1.2 var(--serif); }
dialog p { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.65; }

@keyframes drift { to { transform: translate(22%,-16%) scale(1.15); } }
@keyframes sway { to { transform: translateX(-30px); } }
@keyframes truck-arrival {
    0% { opacity: 0; transform: translateX(-82px) rotate(-2.5deg) scale(.96); }
    62% { opacity: 1; transform: translateX(7px) rotate(.7deg) scale(1.015); }
    80% { transform: translateX(-3px) rotate(-.25deg) scale(.995); }
    100% { opacity: 1; transform: none; }
}
@keyframes divider-arrival { from { opacity: 0; transform: scaleY(.25); } to { opacity: 1; transform: scaleY(1); } }
@keyframes letter-arrival {
    from { opacity: 0; transform: translateX(-8px) translateY(7px); filter: blur(3px); }
    to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes tagline-arrival { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes route-pulse { from { transform: scale(.6); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
.access-content > *, .brand-message h1, .brand-message p, .brand-footer { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.access-content > *:nth-child(2) { animation-delay: .08s; }
.access-content > *:nth-child(3) { animation-delay: .16s; }
.access-content > *:nth-child(4) { animation-delay: .24s; }
.access-content > *:nth-child(5) { animation-delay: .32s; }
.brand-message p { animation-delay: .12s; }
.brand-footer { animation-delay: .3s; }

@media (max-width: 1050px) { .brand-panel { padding: 42px 38px; } .brand-footer { gap: 20px; } }
@media (max-width: 860px) {
    .login-layout { grid-template-columns: 1fr; }
    .brand-panel { display: none; }
    .access-panel { min-height: 100vh; min-height: 100dvh; padding: max(32px, env(safe-area-inset-top)) 24px max(32px, env(safe-area-inset-bottom)); }
    .mobile-brand { display: flex; }
}
@media (max-width: 430px) {
    .mobile-brand { gap: 10px; }
    .mobile-brand .brand-logo-image { width: 122px; }
    .mobile-brand .brand-copy strong { font-size: 22px; }
    .mobile-brand .brand-copy small { max-width: 145px; font-size: 8px; letter-spacing: .12em; }
}
@media (max-width: 390px) { .form-options { align-items: flex-start; flex-direction: column; } .access-footer { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
