:root {
    color-scheme: dark;
    --bg: #090b0d;
    --surface: #12161a;
    --surface-strong: #171d22;
    --line: #2b343c;
    --text: #f5f7f8;
    --muted: #9aa6ae;
    --cyan: #42d4e8;
    --amber: #ffbd45;
    --coral: #ff6b57;
    --success: #58d68d;
    --danger: #ff7b72;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

button, input { font: inherit; letter-spacing: 0; }

.topbar {
    width: min(1180px, calc(100% - 48px));
    min-height: 82px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    font-size: 18px;
    font-weight: 800;
}

.brand img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.language {
    width: 44px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
    font-weight: 700;
}

.language:hover, .language:focus-visible { border-color: var(--cyan); outline: none; }

.shell {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 64px 0 54px;
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(500px, 1.15fr);
    gap: 76px;
    align-items: start;
}

.intro { padding: 34px 0 0; }

.eyebrow, .step {
    margin: 0 0 15px;
    color: var(--amber);
    font-size: 12px;
    font-weight: 800;
}

h1 {
    margin: 0;
    max-width: 560px;
    font-size: 64px;
    line-height: 1.02;
    font-weight: 800;
}

.lead {
    max-width: 540px;
    margin: 25px 0 0;
    color: var(--muted);
    font-size: 19px;
    line-height: 1.6;
}

.privacy-note {
    max-width: 540px;
    margin-top: 42px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 14px;
}

.privacy-mark {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--success);
    border-radius: 50%;
    color: var(--success);
    font-weight: 800;
}

.privacy-note strong { display: block; margin: 2px 0 6px; font-size: 15px; }
.privacy-note p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

.tool {
    padding: 30px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--cyan);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.tool-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.tool-heading h2 { margin: 0; font-size: 26px; }
.step { margin-bottom: 6px; color: var(--cyan); }

.secure-badge {
    padding: 7px 9px;
    border: 1px solid #3c704d;
    border-radius: 5px;
    color: var(--success);
    font-size: 11px;
    font-weight: 800;
}

.field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 14px;
}

.credentials-row { grid-template-columns: 1fr 1fr; }

.field { display: block; margin-bottom: 18px; }

.field > span, legend {
    display: block;
    margin-bottom: 8px;
    color: #dfe5e8;
    font-size: 13px;
    font-weight: 700;
}

.field small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

input {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: none;
    color: var(--text);
    background: #0d1114;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

input::placeholder { color: #65717a; }
input:hover { border-color: #46535d; }
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(66, 212, 232, 0.13); }
.device-field input {
    height: 58px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
}

.mode-fieldset { margin: 2px 0 20px; padding: 0; border: 0; }
.mode-fieldset legend { padding: 0; }

.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 46px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #0d1114;
}

.segment {
    border: 0;
    border-radius: 4px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.segment.active { color: #061014; background: var(--cyan); }
.segment:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.status {
    margin: 4px 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    background: var(--surface-strong);
    font-size: 14px;
    line-height: 1.5;
}

.status.success { border-color: #3c704d; color: var(--success); }
.status.error { border-color: #743d3a; color: var(--danger); }

.submit {
    width: 100%;
    min-height: 54px;
    padding: 0 17px;
    border: 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #061014;
    background: var(--cyan);
    cursor: pointer;
    font-weight: 850;
}

.submit:hover { background: #70e2ef; }
.submit:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.submit:disabled { cursor: wait; opacity: 0.62; }
.button-arrow { font-size: 25px; line-height: 1; }

footer {
    width: min(1180px, calc(100% - 48px));
    min-height: 64px;
    margin: 0 auto;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
    font-size: 12px;
}

footer span:first-child { color: var(--text); font-weight: 800; }

@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; gap: 42px; padding-top: 38px; }
    .intro { padding-top: 0; }
    .privacy-note { margin-top: 28px; }
    h1 { font-size: 50px; }
}

@media (max-width: 580px) {
    .topbar, .shell, footer { width: min(100% - 28px, 1180px); }
    .topbar { min-height: 70px; }
    .brand img { width: 42px; height: 42px; }
    .shell { padding: 30px 0 38px; gap: 30px; }
    h1 { font-size: 40px; }
    .lead { font-size: 16px; }
    .tool { padding: 22px 18px; }
    .field-row, .credentials-row { grid-template-columns: 1fr; gap: 0; }
    footer { min-height: 78px; align-items: flex-start; justify-content: center; flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}
