:root {
    --ink: #0b1424;
    --muted: #667085;
    --line: #dce3ec;
    --surface: #ffffff;
    --brand: #e31d3b;
    --brand-dark: #bd102b;
    --navy: #07101e;
    --navy-soft: #0d1b2f;
    --focus: rgba(227, 29, 59, .18);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    color: var(--ink);
    background: #f5f7fa;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    padding: 10px 14px;
    color: #fff;
    background: var(--brand);
    border-radius: 8px;
    transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.login-shell {
    display: grid;
    grid-template-columns: minmax(520px, 1.12fr) minmax(500px, .88fr);
    min-height: 100vh;
}

.brand-stage {
    position: relative;
    min-height: 100vh;
    padding: 42px clamp(44px, 6vw, 100px) 34px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 85% 10%, rgba(227, 29, 59, .16), transparent 28%),
        linear-gradient(145deg, #07101e 0%, #0b1729 54%, #07111e 100%);
    isolation: isolate;
}

.brand-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .16;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
    pointer-events: none;
}

.grid-glow {
    position: absolute;
    inset: 46% -10% -15% 10%;
    z-index: -2;
    opacity: .15;
    background-image: linear-gradient(rgba(255,255,255,.15) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.15) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: linear-gradient(to bottom, transparent, #000 30%, transparent);
    transform: perspective(500px) rotateX(58deg) scale(1.25);
}

.aurora {
    position: absolute;
    z-index: -1;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
}

.aurora-one { top: 24%; right: -190px; background: rgba(227, 29, 59, .24); }
.aurora-two { bottom: -190px; left: 18%; background: rgba(34, 115, 179, .18); }

.brand-header, .brand-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-header { position: relative; z-index: 2; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.brand-mark, .mini-logo {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: #fff;
    background: linear-gradient(145deg, #f52b4b, #c90d2b);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(227, 29, 59, .3), inset 0 1px rgba(255,255,255,.25);
    font-size: 21px;
    font-weight: 900;
    letter-spacing: -.04em;
}

.brand-name { font-size: 19px; font-weight: 800; letter-spacing: .12em; }

.portal-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #cbd5e1;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 999px;
    background: rgba(255,255,255,.04);
    backdrop-filter: blur(12px);
    font-size: 12px;
    font-weight: 600;
}

.portal-pill span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52,211,153,.11);
}

.brand-copy {
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin-top: clamp(92px, 14vh, 150px);
}

.eyebrow {
    max-width: 540px;
    margin: 0 0 24px;
    color: #f08a9b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
    line-height: 1.6;
    text-transform: uppercase;
}

.brand-copy h1 {
    margin: 0;
    font-size: clamp(45px, 5vw, 76px);
    font-weight: 750;
    letter-spacing: -.055em;
    line-height: 1.02;
}

.brand-copy h1 span {
    color: transparent;
    background: linear-gradient(100deg, #ffffff 5%, #9cacc4 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.lead {
    max-width: 570px;
    margin: 28px 0 0;
    color: #aab7c9;
    font-size: clamp(16px, 1.4vw, 19px);
    line-height: 1.75;
}

.trust-row { display: flex; gap: 34px; margin-top: 42px; }
.trust-item { display: flex; align-items: center; gap: 12px; }
.trust-item > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.trust-item strong { color: #edf2f7; font-size: 13px; }
.trust-item small { color: #7f8da2; font-size: 11px; }

.trust-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #f0647a;
    border: 1px solid rgba(240,100,122,.2);
    border-radius: 11px;
    background: rgba(227,29,59,.08);
}

.trust-icon svg, .secure-badge svg, .field-icon svg, .password-toggle svg,
.security-note svg, .support-icon svg, .support-box a svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.insight-card {
    position: absolute;
    right: clamp(34px, 5vw, 84px);
    bottom: 78px;
    z-index: 3;
    width: min(360px, 38vw);
    padding: 18px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px;
    background: rgba(15, 28, 47, .74);
    box-shadow: 0 30px 60px rgba(0,0,0,.25);
    backdrop-filter: blur(20px);
    transform: rotate(-2deg);
}

.insight-top { display: flex; align-items: center; gap: 10px; }
.mini-logo { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
.insight-top > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; }
.insight-top b { font-size: 11px; }
.insight-top small { margin-top: 3px; color: #75849a; font-size: 9px; }
.status-dot { padding: 5px 8px; color: #5ee0aa; background: rgba(52,211,153,.08); border-radius: 99px; font-size: 8px; font-weight: 800; }
.insight-content { display: flex; align-items: flex-end; gap: 22px; margin-top: 20px; }
.insight-chart { display: flex; flex: 1; align-items: flex-end; gap: 5px; height: 56px; }
.insight-chart i { flex: 1; height: 35%; border-radius: 3px 3px 1px 1px; background: rgba(227,29,59,.25); }
.insight-chart i:nth-child(2) { height: 55%; }.insight-chart i:nth-child(3) { height: 44%; }.insight-chart i:nth-child(4) { height: 75%; }
.insight-chart i:nth-child(5) { height: 62%; }.insight-chart i:nth-child(6) { height: 88%; background: #e31d3b; }.insight-chart i:nth-child(7) { height: 78%; }
.insight-stat { display: flex; flex-direction: column; min-width: 92px; }
.insight-stat span, .insight-stat small { color: #78869a; font-size: 8px; }
.insight-stat strong { margin: 3px 0; font-size: 23px; letter-spacing: -.05em; }

.brand-footer {
    position: absolute;
    right: clamp(44px, 6vw, 100px);
    bottom: 32px;
    left: clamp(44px, 6vw, 100px);
    color: #66758a;
    font-size: 10px;
    letter-spacing: .05em;
}

.form-stage {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 46px clamp(36px, 6vw, 92px) 30px;
    background:
        radial-gradient(circle at 100% 0, rgba(227,29,59,.04), transparent 24%),
        #f7f8fa;
}

.mobile-brand { display: none; }
.login-card { width: min(100%, 440px); }
.card-heading { margin-bottom: 30px; }

.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    padding: 7px 10px;
    color: #b2112a;
    background: #fff0f2;
    border: 1px solid #ffd8df;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.secure-badge svg { width: 14px; }
.card-heading h2 { margin: 0; font-size: clamp(31px, 3vw, 40px); letter-spacing: -.045em; line-height: 1.1; }
.card-heading p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

.form-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 13px 14px;
    color: #95132a;
    border: 1px solid #ffc8d1;
    border-radius: 12px;
    background: #fff1f3;
    font-size: 13px;
    line-height: 1.45;
}

.alert-icon {
    display: grid;
    flex: 0 0 20px;
    place-items: center;
    width: 20px;
    height: 20px;
    color: #fff;
    background: var(--brand);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 900;
}

.field-group { margin-bottom: 20px; }
.field-group label { display: inline-block; margin-bottom: 9px; color: #263246; font-size: 12px; font-weight: 750; }
.label-row { display: flex; justify-content: space-between; }
.caps-warning { display: none; color: #b54708; font-size: 11px; font-weight: 650; }
.caps-warning.visible { display: inline; }
.field-wrap { position: relative; }

.form-input {
    width: 100%;
    height: 56px;
    padding: 0 48px;
    color: #111c2d;
    caret-color: var(--brand);
    border: 1px solid var(--line);
    border-radius: 13px;
    outline: 0;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(16,24,40,.02);
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.form-input::placeholder { color: #a3adba; }
.form-input:hover { border-color: #bdc7d5; }
.form-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--focus), 0 8px 20px rgba(16,24,40,.05); }
.form-input.invalid { border-color: var(--brand); animation: shake .32s ease; }
.field-icon { position: absolute; top: 50%; left: 16px; z-index: 1; color: #78869a; transform: translateY(-50%); pointer-events: none; }
.field-icon svg { width: 19px; }
.field-wrap:focus-within .field-icon { color: var(--brand); }
.password-input { padding-right: 52px; }

.password-toggle {
    position: absolute;
    top: 50%;
    right: 9px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: #7f8b9c;
    border: 0;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover { color: var(--ink); background: #f1f3f6; }
.password-toggle:focus-visible { outline: 3px solid var(--focus); }
.password-toggle .eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }
.field-hint { display: block; margin-top: 7px; color: #8792a2; font-size: 10px; line-height: 1.4; }
.submit-panel { margin-top: 26px; }

.login-button {
    width: 100%;
    height: 56px;
    padding: 0 24px;
    color: #fff;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(110deg, #e31d3b, #cf1230);
    box-shadow: 0 12px 28px rgba(207,18,48,.22), inset 0 1px rgba(255,255,255,.2);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .015em;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, filter .2s;
}

.login-button:hover { box-shadow: 0 16px 34px rgba(207,18,48,.3); filter: saturate(1.08); transform: translateY(-1px); }
.login-button:active { transform: translateY(1px); }
.login-button:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
.login-button.loading { color: transparent; pointer-events: none; }
.login-button.loading::after { content: ""; display: block; width: 18px; height: 18px; margin: -37px auto 0; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }

.security-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 14px; color: #8792a2; font-size: 10px; }
.security-note svg { width: 14px; color: #42a67a; }

.support-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 34px;
    padding: 14px;
    border: 1px solid #e2e7ee;
    border-radius: 14px;
    background: rgba(255,255,255,.72);
}

.support-icon { display: grid; flex: 0 0 36px; place-items: center; width: 36px; height: 36px; color: #5f6c80; border-radius: 10px; background: #eef1f5; }
.support-icon svg { width: 18px; }
.support-box > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.support-box b { color: #344054; font-size: 11px; }
.support-box small { color: #8a95a5; font-size: 9px; }
.support-box a { display: grid; place-items: center; width: 32px; height: 32px; color: var(--brand); border-radius: 8px; }
.support-box a:hover { background: #fff0f2; }
.support-box a svg { width: 17px; }
.legal-copy { margin: 28px 0 0; color: #98a2b3; font-size: 9px; text-align: center; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 25% { transform: translateX(-3px); } 50% { transform: translateX(3px); } 75% { transform: translateX(-2px); } }

@media (max-width: 1100px) {
    .login-shell { grid-template-columns: minmax(460px, .95fr) minmax(460px, 1.05fr); }
    .brand-stage { padding-inline: 44px; }
    .brand-copy h1 { font-size: 50px; }
    .insight-card { display: none; }
}

@media (max-width: 860px) {
    .login-shell { display: block; }
    .brand-stage { display: none; }
    .form-stage { min-height: 100svh; padding: 30px 24px; background: radial-gradient(circle at 100% 0, rgba(227,29,59,.09), transparent 30%), #f6f7f9; }
    .mobile-brand { display: flex; align-items: center; gap: 10px; width: min(100%, 440px); margin: 0 auto 48px; }
    .mobile-brand .brand-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 17px; }
    .mobile-brand .brand-name { color: #101828; font-size: 16px; }
}

@media (max-width: 480px) {
    .form-stage { justify-content: flex-start; padding: max(24px, env(safe-area-inset-top)) 18px 24px; }
    .mobile-brand { margin-bottom: 42px; }
    .card-heading { margin-bottom: 26px; }
    .card-heading h2 { font-size: 31px; }
    .form-input, .login-button { height: 54px; }
    .support-box { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (prefers-contrast: more) {
    .form-input { border-color: #7b8798; }
    .field-hint, .legal-copy { color: #5e6877; }
}
