:root {
    --navy: #005361;
    --cyan: #009bb6;
    --violet: #6136ff;
    --mint: #B8DFCA;
    --deep: #002a32;
    --ink: #10292e;
    --muted: #5d7380;
    --line: #d5e4e0;
    --paper: #f4fbf8;
    --danger: #be123c;
    --danger-bg: #fff1f2;
    --ok: #16794a;
    --ok-bg: #e8f6ee;
    --font: "Quicksand", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body.gate {
    min-height: 100dvh;
    font-family: var(--font);
    color: var(--ink);
    background: var(--deep);
    -webkit-font-smoothing: antialiased;
}

.gate-atmos {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(880px 520px at 100% -8%, rgba(97, 54, 255, .42), transparent 58%),
        radial-gradient(760px 520px at -12% 108%, rgba(0, 155, 182, .4), transparent 56%),
        radial-gradient(420px 280px at 68% 100%, rgba(184, 223, 202, .14), transparent 60%),
        var(--deep);
}

.gate-atmos .mesh {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 68px 68px;
    mask-image: radial-gradient(ellipse 65% 55% at 28% 42%, #000 12%, transparent 72%);
}

.gate-atmos .ring {
    position: absolute;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    border: 1px solid rgba(184, 223, 202, .16);
    top: 16%;
    left: 8%;
}

.gate-atmos .ring::after {
    content: "";
    position: absolute;
    inset: 36px;
    border-radius: 50%;
    border: 1px solid rgba(97, 54, 255, .28);
}

.gate-frame {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-bottom: 28px;
}

.gate-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 2px 10px;
}

.gate-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.gate-brand img {
    height: 36px;
    width: auto;
    display: block;
}

.gate-secure {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(184, 223, 202, .32);
    background: rgba(184, 223, 202, .08);
    color: rgba(255, 255, 255, .78);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.gate-secure i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 4px rgba(184, 223, 202, .16);
}

.gate-body {
    flex: 1;
    display: flex;
    align-items: center;
}

.gate-body.is-tall { align-items: flex-start; padding-top: 8px; }

.gate-body.is-solo { justify-content: center; }

.gate-stage {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 430px);
    gap: 28px;
    align-items: center;
}

.gate-body.is-tall .gate-stage { align-items: start; }

.gate-glass {
    position: absolute;
    z-index: 0;
    top: 0;
    bottom: 0;
    left: 0;
    right: 32%;
    border-radius: 32px;
    background: linear-gradient(165deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03));
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.gate-story,
.gate-sheet { position: relative; z-index: 1; }

.gate-story { padding: 40px 8px 40px 36px; }

.gate-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    color: var(--mint);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.gate-eyebrow i {
    width: 22px;
    height: 2px;
    border-radius: 99px;
    background: var(--violet);
}

.gate-title {
    margin: 0 0 14px;
    max-width: 12ch;
    color: #fff;
    font-size: clamp(2.5rem, 4.2vw, 3.7rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -.04em;
}

.gate-title em {
    font-style: normal;
    color: var(--mint);
}

.gate-lead {
    margin: 0 0 28px;
    max-width: 36ch;
    color: rgba(255, 255, 255, .68);
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.6;
}

.gate-index {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.gate-index li {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255, 255, 255, .9);
    font-weight: 600;
    font-size: .98rem;
}

.gate-index b {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(0, 42, 50, .35);
    color: var(--mint);
    font-size: 12px;
    letter-spacing: .04em;
}

.gate-sheet {
    background: #fff;
    border-radius: 28px;
    padding: 32px 30px 26px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .8) inset,
        0 28px 70px rgba(0, 16, 22, .38);
}

.gate-body.is-duo:not(.is-tall) .gate-sheet { margin-left: -18px; }

.gate-body.is-solo .gate-sheet { width: min(100%, 460px); }

.gate-sheet::before {
    content: "";
    position: absolute;
    left: 24px;
    right: 24px;
    top: 0;
    height: 3px;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(90deg, var(--cyan), var(--violet));
}

.sheet-head { margin-bottom: 22px; }

.sheet-kicker {
    margin: 0 0 8px;
    color: var(--violet);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.sheet-head h2,
.success-box h2 {
    margin: 0 0 6px;
    color: var(--navy);
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.15;
}

.sheet-head p,
.success-box p {
    margin: 0;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.55;
    font-weight: 500;
}

.mark {
    width: 54px;
    height: 54px;
    margin-bottom: 16px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: var(--navy);
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(140deg, var(--cyan), var(--violet)) border-box;
    border: 1.5px solid transparent;
    box-shadow: 0 10px 24px rgba(0, 83, 97, .1);
}

.sheet-form,
.step-panel.active { display: grid; gap: 14px; }

.step-panel { display: none; }

.rail {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 22px;
}

.rail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8aa0a8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
}

.rail-item span {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e7f2ef;
    color: var(--navy);
    font-size: 12px;
}

.rail-item.active,
.rail-item.done { color: var(--navy); }

.rail-item.active span,
.rail-item.done span {
    background: var(--navy);
    color: #fff;
}

.rail-item.done span { background: var(--cyan); }

.field { display: grid; gap: 6px; }

.field label {
    color: #3d5860;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
}

.field input,
.field select {
    width: 100%;
    height: 50px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
    color: var(--ink);
    padding: 0 14px;
    font: 500 16px/1 var(--font);
    outline: none;
    appearance: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.field select {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23005361' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.field input:focus,
.field select:focus {
    border-color: var(--violet);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(97, 54, 255, .12);
}

.field input.err,
.field select.err {
    border-color: var(--danger);
    background-color: #fff8f8;
}

.field input:-webkit-autofill {
    -webkit-text-fill-color: var(--ink);
    box-shadow: 0 0 0 1000px var(--paper) inset;
    caret-color: var(--ink);
}

.field-box { position: relative; }

.field-box input { padding-right: 46px; }

.eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: #7d949c;
    cursor: pointer;
}

.field-box:focus-within .eye { color: var(--violet); }

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.chk {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.chk input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.chk-box {
    width: 18px;
    height: 18px;
    border: 1.5px solid #c5d8d4;
    border-radius: 6px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chk input:focus-visible + .chk-box { box-shadow: 0 0 0 4px rgba(97, 54, 255, .16); }

.chk input:checked + .chk-box {
    background: var(--navy);
    border-color: var(--navy);
}

.chk-mark { opacity: 0; transform: scale(.6); }
.chk input:checked + .chk-box .chk-mark { opacity: 1; transform: none; }

.forgot,
.sheet-foot a,
.sheet-links a {
    color: var(--navy);
    font-weight: 700;
    font-size: .9rem;
    text-decoration: none;
}

.forgot:hover,
.sheet-foot a:hover,
.sheet-links a:hover { color: var(--violet); }

.gate .btn {
    position: relative;
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(115deg, #005361 0%, #009bb6 78%);
    color: #fff;
    font: 700 16px/1 var(--font);
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(0, 83, 97, .26);
    transition: transform .18s, box-shadow .18s, background .18s;
}

.gate .btn:hover:not(:disabled) {
    transform: translateY(-1px);
    background: linear-gradient(115deg, #003842 0%, #009bb6 58%, #6136ff 150%);
    box-shadow: 0 16px 30px rgba(0, 83, 97, .32);
}

.gate .btn:disabled { opacity: .72; cursor: not-allowed; }

.gate .btn-ghost {
    background: #fff;
    color: var(--navy);
    border: 1px solid var(--line);
    box-shadow: none;
}

.gate .btn-ghost:hover:not(:disabled) {
    background: var(--paper);
    color: var(--navy);
    transform: none;
    box-shadow: none;
}

.btn .spin {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .75s linear infinite;
}

.btn.loading .lbl { opacity: 0; }
.btn.loading .spin { display: block; position: absolute; }

.step-nav { display: flex; gap: 10px; }
.step-nav .btn { flex: 1; }

.sheet-foot {
    margin: 18px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 500;
}

.sheet-links {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: .88rem;
    line-height: 1.45;
    font-weight: 600;
}

.alert-err {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #f4c7c3;
}

.alert-ok {
    background: var(--ok-bg);
    color: var(--ok);
    border: 1px solid #c9e3cf;
}

.s-wrap,
.strength-wrap { display: grid; gap: 6px; }

.s-bars,
.strength-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.sbar {
    height: 4px;
    border-radius: 99px;
    background: #e3eeeb;
}

.s-lbl,
.strength-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.str1 .sbar:nth-child(1),
.s1 .sbar:nth-child(1) { background: #be123c; }

.str2 .sbar:nth-child(-n+2),
.s2 .sbar:nth-child(-n+2) { background: #d97706; }

.str3 .sbar:nth-child(-n+3),
.s3 .sbar:nth-child(-n+3) { background: var(--cyan); }

.str4 .sbar,
.s4 .sbar { background: var(--navy); }

.match-hint {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    font-weight: 700;
    color: var(--ok);
}

.match-hint.show { display: flex; }
.match-hint.bad { color: var(--danger); }

.success-box { text-align: left; }

.success-ico {
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--ok-bg);
    color: var(--ok);
}

@keyframes lift {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes spin { to { transform: rotate(360deg); } }

.gate-story,
.gate-sheet { animation: lift .4s ease both; }

@media (max-width: 900px) {
    .gate-frame { width: min(100% - 28px, 640px); }
    .gate-bar { padding-top: 18px; }
    .gate-brand img { height: 30px; }
    .gate-body,
    .gate-body.is-tall { align-items: stretch; padding-top: 8px; }
    .gate-stage {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .gate-glass { display: none; }
    .gate-story { padding: 8px 2px 0; }
    .gate-title {
        max-width: none;
        font-size: clamp(1.8rem, 8vw, 2.3rem);
    }
    .gate-lead { margin-bottom: 0; font-size: .95rem; }
    .gate-index { display: none; }
    .gate-body.is-duo:not(.is-tall) .gate-sheet,
    .gate-body.is-tall .gate-sheet { margin-left: 0; }
    .gate-sheet { padding: 26px 18px 20px; border-radius: 22px; }
    .gate-atmos .ring { display: none; }
}

@media (max-width: 520px) {
    .grid2 { grid-template-columns: 1fr; }
    .sheet-head h2 { font-size: 1.45rem; }
}

@media (max-height: 760px) and (min-width: 901px) {
    .gate-story { padding-top: 24px; padding-bottom: 24px; }
    .gate-title { font-size: 2.6rem; }
    .gate-index b { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
