:root {
    color-scheme: light;
    --ink: #14213d;
    --muted: #62708a;
    --line: #dce3ee;
    --surface: #ffffff;
    --canvas: #eef3f9;
    --blue: #1769e0;
    --blue-dark: #0c4eb5;
    --blue-soft: #eaf2ff;
    --danger: #a92424;
    --danger-soft: #fff0f0;
    --warning: #7a4b00;
    --warning-soft: #fff7df;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 8%, rgba(23, 105, 224, .13), transparent 31rem),
        linear-gradient(145deg, #f8fbff 0%, var(--canvas) 100%);
}

button, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0;
}

.panel {
    overflow: hidden;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(204, 215, 230, .9);
    border-radius: 22px;
    box-shadow: 0 22px 70px rgba(27, 55, 94, .12);
}

.panel__header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 26px 30px;
    border-bottom: 1px solid var(--line);
}

.mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    color: white;
    background: var(--blue);
    border-radius: 14px;
    box-shadow: 0 9px 22px rgba(23, 105, 224, .28);
}

.mark svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow {
    margin: 0 0 4px;
    color: var(--blue);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.35rem, 3vw, 1.8rem); line-height: 1.18; }
h2 { margin-bottom: 8px; font-size: 1.2rem; }

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    min-height: 510px;
}

.form-card {
    padding: 32px 30px;
    border-right: 1px solid var(--line);
}

.field { margin-bottom: 22px; }

.field label {
    display: block;
    margin-bottom: 8px;
    font-size: .92rem;
    font-weight: 720;
}

.field input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    color: var(--ink);
    background: white;
    border: 1px solid #bbc7d8;
    border-radius: 10px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.field input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(23, 105, 224, .13);
}

.field__hint {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.4;
}

.password-wrap { position: relative; }
.password-wrap input { padding-right: 82px; }

.account-type,
.device-type {
    min-width: 0;
    padding: 0;
    border: 0;
}

.account-type legend,
.device-type legend {
    margin-bottom: 8px;
    padding: 0;
    font-size: .92rem;
    font-weight: 720;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.choice {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 68px;
    align-items: center;
    padding: 11px 12px;
    background: #fff;
    border: 1px solid #bbc7d8;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.choice:has(input:checked) {
    background: var(--blue-soft);
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(23, 105, 224, .1);
}

.choice input {
    width: 18px;
    height: 18px;
    margin: 0 10px 0 0;
    accent-color: var(--blue);
}

.choice span { min-width: 0; }
.choice strong, .choice small { display: block; }
.choice strong { font-size: .92rem; }
.choice small { margin-top: 3px; color: var(--muted); font-size: .73rem; line-height: 1.3; }

.icon-button {
    position: absolute;
    top: 5px;
    right: 6px;
    height: 38px;
    padding: 0 9px;
    color: var(--blue-dark);
    font-size: .8rem;
    font-weight: 750;
    background: transparent;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
}

.icon-button:hover { background: var(--blue-soft); }

.primary-button, .secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    font-weight: 760;
    text-decoration: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .14s ease, background-color .14s ease, box-shadow .14s ease;
}

.primary-button {
    width: 100%;
    color: #fff;
    background: var(--blue);
    border: 1px solid var(--blue);
    box-shadow: 0 8px 18px rgba(23, 105, 224, .2);
}

.primary-button:hover { background: var(--blue-dark); }
.primary-button:active, .secondary-button:active { transform: translateY(1px); }

.secondary-button {
    min-height: 38px;
    padding: 0 13px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
}

.privacy-note {
    margin: 15px 0 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.5;
    text-align: center;
}

.result-card, .empty-card { padding: 32px; }

.result-card__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.result-card__heading h2 { overflow-wrap: anywhere; }

.result-server {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.qr-frame {
    width: min(100%, 370px);
    margin: 0 auto 20px;
    padding: 14px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(22, 46, 78, .11);
}

#qr-canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }

.result-actions { width: min(100%, 370px); margin: 0 auto 24px; }

.steps {
    margin: 0 0 20px;
    padding-left: 22px;
    color: #3d4a61;
    font-size: .92rem;
    line-height: 1.6;
}

.message {
    padding: 11px 13px;
    font-size: .88rem;
    line-height: 1.45;
    border: 1px solid transparent;
    border-radius: 9px;
}

.message--error { margin-bottom: 16px; color: var(--danger); background: var(--danger-soft); border-color: #f3c4c4; }
.message--warning { color: var(--warning); background: var(--warning-soft); border-color: #ead9a4; }

.empty-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-align: center;
}

.empty-card h2 { color: var(--ink); }
.empty-card p { max-width: 330px; line-height: 1.55; }

.empty-card__icon {
    display: grid;
    grid-template-columns: repeat(2, 28px);
    grid-template-rows: repeat(2, 28px);
    gap: 7px;
    margin-bottom: 24px;
    padding: 17px;
    background: var(--blue-soft);
    border-radius: 18px;
}

.empty-card__icon span { border: 7px solid var(--blue); border-radius: 2px; }
.empty-card__icon span:nth-child(2) { border-color: transparent var(--blue) var(--blue) transparent; }
.empty-card__icon span:nth-child(3) { border-color: var(--blue) transparent transparent var(--blue); }
.empty-card__icon span:nth-child(4) { border-width: 5px; }

.server-summary {
    width: min(100%, 430px);
    margin: 12px 0 0;
    text-align: left;
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.server-summary div { padding: 12px 14px; }
.server-summary div + div { border-top: 1px solid var(--line); }
.server-summary dt { margin-bottom: 3px; font-size: .76rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.server-summary dd { margin: 0; color: var(--ink); font-size: .85rem; overflow-wrap: anywhere; }

.brand-footer {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: center;
    gap: 13px;
    padding: 13px 24px;
    color: #d8dde3;
    font-size: .78rem;
    font-weight: 650;
    letter-spacing: .035em;
    background: #292d31;
    border-top: 1px solid #202428;
}

.brand-footer img {
    display: block;
    width: 148px;
    height: auto;
    border-radius: 3px;
}

[hidden] { display: none !important; }

@media (max-width: 760px) {
    .shell { width: min(100% - 20px, 620px); padding: 16px 0; }
    .panel { border-radius: 16px; }
    .panel__header { padding: 21px 20px; }
    .content-grid { grid-template-columns: 1fr; }
    .form-card { padding: 25px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
    .result-card, .empty-card { padding: 25px 20px; }
    .empty-card { min-height: 330px; }
}

@media (max-width: 420px) {
    .choice-grid { grid-template-columns: 1fr; }
    .brand-footer { min-height: 62px; padding: 11px 16px; }
    .brand-footer img { width: 132px; }
}

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