:root {
    --gate-navy: #00274e;
    --gate-navy-deep: #0f3d6e;
    --gate-ink: #0b1c30;
    --gate-muted: #43474f;
    --gate-outline: #737780;
    --gate-line: #d5deea;
    --gate-page: #f8f9ff;
    --gate-soft: #eff4ff;
    --gate-white: #ffffff;
    --gate-blue: #006398;
    --gate-sky: #5bb8fe;
    --gate-mint: #4edea3;
    --gate-error: #ba1a1a;
    --gate-error-bg: #ffdad6;
    --gate-shadow: 0 18px 50px rgba(11, 28, 48, 0.12);
    --gate-radius: 20px;
    --font-body: "Be Vietnam Pro", "Segoe UI", sans-serif;
    --font-ui: Inter, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--gate-page);
    color: var(--gate-ink);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.45;
}

button, input { font: inherit; }

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
}

.gate-card {
    width: min(1180px, 100%);
    min-height: 640px;
    display: grid;
    grid-template-columns: 5fr 7fr;
    background: var(--gate-white);
    border-radius: var(--gate-radius);
    box-shadow: var(--gate-shadow);
    overflow: hidden;
}

.gate-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    padding: 32px 28px;
    background: var(--gate-navy);
    color: #fff;
    overflow: hidden;
}

.gate-brand-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.gate-brand-glow-top {
    width: 280px;
    height: 280px;
    top: -90px;
    left: -90px;
    background: rgba(91, 184, 254, 0.16);
    filter: blur(8px);
}

.gate-brand-glow-bottom {
    width: 320px;
    height: 320px;
    right: -80px;
    bottom: -90px;
    background: rgba(0, 70, 46, 0.45);
    filter: blur(10px);
}

.gate-brand-copy,
.gate-visual,
.gate-brand-foot { position: relative; z-index: 1; }

.gate-status,
.gate-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.gate-status {
    width: fit-content;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-family: var(--font-ui);
    font-size: 11px;
    letter-spacing: 0.02em;
}

.gate-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gate-mint);
    box-shadow: 0 0 0 0 rgba(78, 222, 163, 0.7);
    animation: gate-pulse 1.8s infinite;
}

@keyframes gate-pulse {
    70% { box-shadow: 0 0 0 6px rgba(78, 222, 163, 0); }
    100% { box-shadow: 0 0 0 0 rgba(78, 222, 163, 0); }
}

.gate-brand h1 {
    margin: 16px 0 0;
    font-size: 28px;
    line-height: 1.25;
    font-weight: 600;
}

.gate-brand-copy p {
    margin: 10px 0 0;
    color: #d4e3ff;
    max-width: 36rem;
}

.gate-visual {
    position: relative;
    height: 210px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--gate-navy-deep);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.gate-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.gate-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 39, 78, 0.72), transparent 55%);
}

.gate-match,
.gate-telemetry,
.gate-box { position: absolute; z-index: 1; }

.gate-match {
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(11, 28, 48, 0.72);
    color: #6ffbbe;
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
}

.gate-match svg,
.gate-roles svg,
.gate-input > svg,
.gate-eye svg,
.gate-submit svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gate-box {
    top: 50%;
    left: 42%;
    width: 92px;
    height: 92px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(91, 184, 254, 0.85);
    border-radius: 8px;
    box-shadow: inset 0 46px 0 rgba(91, 184, 254, 0.35);
}

.gate-telemetry {
    left: 12px;
    right: 12px;
    bottom: 10px;
    display: flex;
    justify-content: space-between;
    color: #d4e3ff;
    font-family: var(--font-ui);
    font-size: 12px;
}

.gate-telemetry strong { color: #fff; font-size: 14px; }

.gate-live { color: var(--gate-mint); font-weight: 600; }

.gate-brand-foot {
    margin: 0;
    color: #a5c8ff;
    font-family: var(--font-ui);
    font-size: 12px;
}

.gate-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: 36px 40px;
}

.gate-kicker-row,
.gate-label-row,
.gate-utils,
.gate-meta,
footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.gate-kicker {
    color: var(--gate-blue);
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.gate-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gate-blue);
    text-decoration: none;
    font-size: 13px;
}

.gate-switch span {
    color: var(--gate-muted);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gate-switch strong { font-weight: 700; }

.gate-switch:hover strong { text-decoration: underline; }

.gate-panel h2 {
    margin: 8px 0 0;
    color: var(--gate-navy);
    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
}

.gate-lead {
    margin: 6px 0 0;
    color: var(--gate-muted);
}

.gate-roles {
    display: flex;
    gap: 4px;
    margin-top: 22px;
    padding: 4px;
    border-radius: 12px;
    background: var(--gate-soft);
}

.gate-roles button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--gate-muted);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.gate-roles button.is-active {
    background: var(--gate-white);
    color: var(--gate-navy);
    box-shadow: 0 1px 3px rgba(11, 28, 48, 0.12);
}

.gate-alert:empty { display: none; }

.gate-alert {
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--gate-error-bg);
    color: var(--gate-error);
}

.gate-alert ul { margin: 0; padding-left: 18px; }

.gate-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
}

.gate-field { display: flex; flex-direction: column; gap: 6px; }

.gate-label-row label,
.gate-search span {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
}

.gate-label-row label span,
.gate-field-error { color: var(--gate-error); }

.gate-label-row > span,
.gate-search span { color: var(--gate-muted); font-weight: 500; }

.gate-input { position: relative; }

.gate-input > svg {
    position: absolute;
    left: 12px;
    top: 13px;
    color: var(--gate-outline);
}

.gate-input input,
.gate-search input {
    width: 100%;
    height: 44px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #f4f7fd;
    color: var(--gate-ink);
    outline: none;
}

.gate-input input { padding: 0 42px 0 40px; }

.gate-input input:focus,
.gate-search input:focus {
    border-color: var(--gate-sky);
    box-shadow: 0 0 0 3px rgba(91, 184, 254, 0.25);
    background: #fff;
}

.gate-eye {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--gate-outline);
    cursor: pointer;
}

.gate-utils { padding-top: 2px; }

.gate-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.gate-remember input { width: 16px; height: 16px; accent-color: var(--gate-navy); }

.gate-utils a,
.gate-switch { font-family: var(--font-ui); }

.gate-utils a {
    color: var(--gate-blue);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.gate-utils a:hover { text-decoration: underline; }

.gate-submit {
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 10px;
    background: var(--gate-navy);
    color: #fff;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(0, 39, 78, 0.18);
}

.gate-submit:hover { background: var(--gate-navy-deep); }

.gate-meta {
    color: var(--gate-muted);
    font-family: var(--font-ui);
    font-size: 12px;
}

.gate-search { display: flex; flex-direction: column; gap: 6px; }

.gate-search input { padding: 0 12px; }

.gate-units {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow: auto;
    padding-right: 4px;
}

.gate-unit {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid var(--gate-line);
    border-radius: 12px;
    background: #fff;
    color: var(--gate-ink);
    text-align: left;
    cursor: pointer;
}

.gate-unit span { font-weight: 600; }

.gate-unit small { color: var(--gate-muted); }

.gate-unit:hover,
.gate-unit.is-current {
    border-color: var(--gate-sky);
    background: var(--gate-soft);
}

.gate-empty { margin: 0; color: var(--gate-muted); }

footer {
    padding: 14px 28px;
    background: var(--gate-white);
    color: var(--gate-muted);
    font-size: 13px;
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.04);
}

.gate-footer-links {
    display: flex;
    align-items: center;
    gap: 18px;
    font-family: var(--font-ui);
    font-size: 12px;
}

.gate-footer-links .gate-dot { animation: none; background: #1dbe85; }

@media (max-width: 980px) {
    .gate-card { grid-template-columns: 1fr; }
    .gate-brand { min-height: auto; }
    .gate-panel { padding: 28px 20px 24px; }
    .gate-panel h2 { font-size: 26px; }
    .gate-kicker-row,
    .gate-utils,
    .gate-meta,
    footer { align-items: flex-start; flex-direction: column; }
    .gate-roles { flex-direction: column; }
}

.gate-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 12px;
    color: var(--gate-outline);
    font-size: 12px;
}

.gate-or::before,
.gate-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--gate-line);
}

.gate-vneid {
    width: 100%;
    min-height: 44px;
    margin-bottom: 8px;
    border-radius: 10px;
    border: 1px solid var(--gate-line);
    background: var(--gate-white);
    color: var(--gate-navy);
    font-weight: 600;
    cursor: pointer;
}
