:root {
    --brand: #1f6feb;
    --brand-dark: #14508f;
    --text: #1f2328;
    --muted: #6b7280;
    --line: #e3e6ea;
    --bg: #f5f7fa;
    --ok: #1a7f37;
    --danger: #b42318;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 28px 18px 60px;
}

h1 { font-size: 26px; line-height: 1.25; margin: 0 0 6px; }
h1 + .lead { font-size: 18px; font-weight: 600; color: var(--brand-dark); margin: 0 0 14px; }
p { margin: 0 0 12px; }

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

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    margin: 14px 0;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.alert {
    background: #fdecea;
    border: 1px solid #f5c2bd;
    color: var(--danger);
    border-radius: 10px;
    padding: 10px 14px;
    margin: 12px 0;
}

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 600; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; }

input[type="text"], input[type="url"], textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd6dd;
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
input[type="text"]:focus, input[type="url"]:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, .12);
}

.btn {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 12px 22px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { background: #9aa7b4; cursor: default; }
.btn-ghost { background: #fff; color: var(--brand-dark); border: 1px solid #cfd6dd; font-weight: 600; }
.btn-ghost:hover { background: #f3f6fa; }

.hp { position: absolute; left: -9999px; }

/* --- экран с вопросами --- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .06);
}
.topbar-title { font-size: 15px; }

.bar {
    margin-top: 8px;
    height: 6px;
    width: 100%;
    min-width: 180px;
    background: #e9edf2;
    border-radius: 20px;
    overflow: hidden;
}
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 20px; }

.timer { text-align: right; white-space: nowrap; }
.timer-label { display: block; font-size: 12px; color: var(--muted); }
.timer-value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }

.question { padding: 16px 18px; }
.q-head { display: flex; gap: 10px; margin-bottom: 12px; }
.q-num {
    flex: 0 0 auto;
    font-weight: 700;
    color: var(--brand-dark);
    background: #eef4ff;
    border-radius: 6px;
    padding: 2px 8px;
    height: fit-content;
}
.q-text { font-weight: 600; }

.option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}
.option:hover { background: #f8fafc; }
.option input { margin-top: 3px; }
.option input:checked + span { font-weight: 600; }
.option:has(input:checked) { border-color: var(--brand); background: #f2f7ff; }

.comment { margin: 10px 0 0; }
.comment textarea { font-size: 15px; }

.submit-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.footer { text-align: center; margin-top: 26px; }

@media (max-width: 560px) {
    .topbar { flex-direction: column; align-items: flex-start; }
    .timer { text-align: left; }
    h1 { font-size: 22px; }
}
