:root {
    --brand-navy: #082233;
    --brand-cyan: #007a91; /* min. 4.5:1 na bialym tle (WCAG AA) */
    --brand-green: #b8cf18;
    --ink: #10202b;
    --muted: #647482;
    --line: #d7e0e7;
    --surface: #ffffff;
    --surface-soft: #f3f7f9;
    --danger: #bf2f45;
    --shadow: 0 20px 60px rgba(8, 34, 51, .16);
    --radius: 8px;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body.quiz-ui {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(0, 122, 145, .11), rgba(243, 247, 249, 0) 340px),
        var(--surface-soft);
}

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

.topbar {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid rgba(16, 32, 43, .1);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--brand-navy);
    text-decoration: none;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: .01em;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--brand-navy);
    color: #fff;
    font-weight: 800;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.hero {
    min-height: calc(100vh - 72px);
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 36px;
    align-items: center;
    padding: 34px 0 42px;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--brand-cyan);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

.hero h1 {
    max-width: 780px;
    margin-bottom: 18px;
    font-size: clamp(42px, 7vw, 84px);
    line-height: .94;
    letter-spacing: 0;
    color: var(--brand-navy);
}

.lead {
    max-width: 650px;
    margin-bottom: 28px;
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.5;
    color: #344b5a;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-width: 650px;
}

.stat {
    min-height: 82px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .72);
}

.stat strong {
    display: block;
    margin-bottom: 4px;
    font-size: 22px;
    color: var(--brand-navy);
}

.stat span {
    color: var(--muted);
    font-size: 13px;
}

.panel {
    background: var(--surface);
    border: 1px solid rgba(8, 34, 51, .12);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.join-panel {
    padding: 24px;
}

.panel-title {
    margin-bottom: 6px;
    font-size: 24px;
    color: var(--brand-navy);
}

.panel-copy {
    margin-bottom: 18px;
    color: var(--muted);
    line-height: 1.45;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
    color: #263b49;
    font-weight: 650;
}

.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
    border: 1px solid #bdcbd4;
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    font: inherit;
    outline: none;
}

textarea { min-height: 110px; resize: vertical; }

.input:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--brand-cyan);
    box-shadow: 0 0 0 3px rgba(0, 122, 145, .16);
}

.btn,
button,
.btn-primary,
.btn-secondary,
.action-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: var(--brand-navy);
    color: #fff;
    font: inherit;
    font-weight: 760;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover,
button:hover,
.btn-primary:hover,
.action-link:hover {
    transform: translateY(-1px);
}

.btn-accent,
.btn-primary {
    background: var(--brand-cyan);
}

.btn-subtle,
.btn-secondary {
    border-color: var(--line);
    background: #fff;
    color: var(--brand-navy);
}

.btn-danger,
.danger {
    background: var(--danger);
    color: #fff;
}

.hint,
.helper,
.footnote {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.notice,
.error {
    margin: 0 0 14px;
    padding: 12px 13px;
    border-radius: var(--radius);
    border: 1px solid rgba(191, 47, 69, .26);
    background: rgba(191, 47, 69, .08);
    color: var(--danger);
}

.notice-ok {
    border-color: rgba(35, 122, 69, .26);
    background: rgba(35, 122, 69, .08);
    color: #237a45;
}

.code-input {
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: 24px;
    font-weight: 800;
    text-align: center;
}

.auth-page,
.join-page {
    min-height: calc(100vh - 72px);
    display: grid;
    place-items: center;
    padding: 34px 0;
}

.narrow-panel {
    width: min(460px, 100%);
    padding: 24px;
}

.session-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.code-pill {
    display: grid;
    gap: 2px;
}

.code-label {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.code-value {
    color: var(--brand-navy);
    font-size: 26px;
    font-weight: 850;
    letter-spacing: .18em;
}

@media (max-width: 820px) {
    .hero {
        min-height: auto;
        grid-template-columns: 1fr;
        padding-top: 28px;
    }

    .quick-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .site-shell {
        width: min(100% - 22px, 1120px);
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 0;
    }

    .brand { font-size: 18px; }
    .join-panel,
    .narrow-panel { padding: 18px; }
    .hero h1 { font-size: 42px; }
}
