:root {
    --accent: #1f6feb;
    --accent-soft: rgba(31, 111, 235, 0.08);
    --ink: #14181f;
    --ink-2: #4a5461;
    --ink-3: #7b8593;
    --line: #e3e7ec;
    --line-strong: #cbd2db;
    --bg: #f6f7f9;
    --surface: #ffffff;
    --danger: #c8272d;
    --danger-soft: #fdf2f2;
    --warn-bg: #fff8e6;
    --warn-line: #f0cf80;
    --ok: #1a7f4b;
    --radius: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

.wrap {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Хедер / футер --- */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 60px;
}

.brand {
    font-weight: 700;
    font-size: 17px;
    color: var(--ink);
    text-decoration: none;
}

.header-left { justify-self: start; }

.header-center {
    justify-self: end;
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
}

.header-link,
.site-footer a {
    color: var(--accent);
    font-size: 14px;
    text-decoration: none;
}

.header-link:hover,
.site-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .header-inner {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 10px;
        min-height: auto;
        padding: 14px 0;
    }

    .header-left,
    .header-center {
        justify-self: center;
    }
}

.site-footer {
    margin: 48px 0 0;
    padding: 24px 0 40px;
    border-top: 1px solid var(--line);
    color: var(--ink-3);
    font-size: 14px;
}

/* --- Вступ --- */

.intro { padding: 40px 0 8px; }

h1 {
    margin: 0 0 12px;
    font-size: 28px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.lead {
    margin: 0;
    color: var(--ink-2);
    font-size: 16px;
}

h2 {
    margin: 0 0 20px;
    font-size: 20px;
    letter-spacing: -0.01em;
}

h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

/* --- 4 кроки --- */

.steps {
    margin: 28px 0 36px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.step-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.step {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.step:first-child {
    padding-top: 0;
    border-top: 0;
}

.step-no {
    flex: 0 0 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-body p {
    margin: 0;
    color: var(--ink-2);
    font-size: 15px;
}

.downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.act-branch {
    margin-top: 16px;
}

.act-branch-title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 600;
}

/* --- Кнопки --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, opacity .15s;
}

.btn-download {
    background: var(--accent-soft);
    border-color: rgba(31, 111, 235, .25);
    color: var(--accent);
}

.btn-download:hover { background: rgba(31, 111, 235, .14); }

.btn-download.is-missing {
    background: #f1f2f4;
    border-color: var(--line-strong);
    color: var(--ink-3);
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    font-size: 16px;
    padding: 14px 28px;
}

.btn-primary:hover { filter: brightness(.94); }

.btn-primary:disabled {
    opacity: .55;
    cursor: not-allowed;
    filter: none;
}

.btn-secondary {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--ink);
}

/* --- Форма --- */

.form { display: block; }

.block {
    margin: 0 0 20px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.block legend {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    margin-bottom: 4px;
    font-size: 17px;
    font-weight: 700;
}

.block-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--ink);
    color: #fff;
    font-size: 13px;
}

.field { margin-top: 20px; }

label,
.label-text {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 600;
}

.req { color: var(--danger); }

input[type="text"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 16px;
}

textarea { resize: vertical; }

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.is-invalid input,
.is-invalid select,
.is-invalid textarea,
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: var(--danger);
}

.hint {
    margin: 6px 0 0;
    color: var(--ink-3);
    font-size: 13.5px;
    font-weight: 400;
}

.counter { white-space: nowrap; }

.error {
    display: none;
    margin: 6px 0 0;
    color: var(--danger);
    font-size: 13.5px;
}

.error.is-visible { display: block; }

.error-global {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--danger-soft);
    border: 1px solid rgba(200, 39, 45, .3);
    border-radius: 8px;
    font-size: 14.5px;
}

/* --- Радіо та чекбокси --- */

.choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.choice {
    flex: 1 1 240px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 13px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
}

.choice:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.store-switch { margin-top: 18px; }

.store-switch > .label-text {
    margin-bottom: 12px;
    font-size: 15px;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

.store-card {
    --store-color: var(--accent);
    --store-tint: color-mix(in srgb, var(--store-color) 10%, white);
    --store-tint-strong: color-mix(in srgb, var(--store-color) 18%, white);
    --store-glow: color-mix(in srgb, var(--store-color) 35%, transparent);

    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 26px 18px 22px;
    border: 1.5px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    box-shadow: 0 1px 2px rgba(20, 24, 31, .04);
    color: var(--ink);
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease, transform .12s ease, background-color .18s ease;
}

.store-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--store-tint), transparent 60%);
    opacity: 0;
    transition: opacity .18s ease;
}

.store-card:hover {
    border-color: var(--store-color);
    box-shadow: 0 10px 24px -8px var(--store-glow);
    transform: translateY(-3px);
}

.store-card:hover::before { opacity: .8; }

.store-card:active { transform: translateY(-1px); }

.store-card-icon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--store-tint);
    font-size: 24px;
    line-height: 1;
    overflow: hidden;
    transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.store-card-icon:has(img) {
    background: #fff;
    border: 1px solid var(--line);
    padding: 9px;
}

.store-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.store-card.is-active .store-card-icon:has(img) {
    background: #fff;
    border-color: var(--store-color);
}

.store-card:hover .store-card-icon {
    transform: scale(1.08);
    box-shadow: 0 4px 12px var(--store-glow);
}

.store-card-name {
    position: relative;
    z-index: 1;
    line-height: 1.3;
    font-weight: 700;
    font-size: 15.5px;
}

.store-card-sub {
    position: relative;
    z-index: 1;
    color: var(--ink-3);
    font-size: 12.5px;
    font-weight: 400;
}

.store-card-check {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--store-color);
    box-shadow: 0 2px 6px var(--store-glow);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(.4);
    transition: opacity .15s ease, transform .15s ease;
}

.store-card.is-active {
    border-color: var(--store-color);
    background: linear-gradient(180deg, var(--store-tint-strong) 0%, #fff 100%);
    box-shadow: 0 10px 24px -8px var(--store-glow), inset 0 0 0 1px var(--store-glow);
}

.store-card.is-active .store-card-icon {
    background: var(--store-color);
    color: #fff;
}

.store-card.is-active .store-card-name { color: var(--store-color); }

.store-card.is-active .store-card-check {
    opacity: 1;
    transform: scale(1);
}

.store-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 0;
    padding: 13px 16px;
    background: var(--accent-soft);
    border: 1px dashed rgba(31, 111, 235, .35);
    border-radius: 10px;
    color: var(--ink-2);
    font-size: 14px;
}

.store-hint span { font-size: 17px; }

.store-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 0 20px;
    padding: 28px 20px;
    background: repeating-linear-gradient(135deg, var(--surface) 0 14px, #f4f6f9 14px 28px);
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--ink-2);
    font-size: 15px;
    text-align: center;
}

.store-gate span { font-size: 22px; }

@media (max-width: 460px) {
    .store-grid { grid-template-columns: repeat(2, 1fr); }
}

.choice input,
.check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 18px 0 0;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.5;
    cursor: pointer;
}

.check input { margin-top: 3px; }

.warning {
    margin: 12px 0 0;
    padding: 14px 16px;
    background: var(--warn-bg);
    border: 1px solid var(--warn-line);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.55;
}

/* --- Завантаження файлів --- */

.badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 600;
    vertical-align: middle;
}

.badge-soft {
    background: #f1f2f4;
    color: var(--ink-3);
}

.badge.is-ready {
    background: rgba(26, 127, 75, .1);
    color: var(--ok);
}

.dropzone {
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius);
    background: #fbfcfd;
    padding: 6px;
}

.dropzone.is-over {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.dropzone-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    margin: 0;
    padding: 22px 16px;
    text-align: center;
    cursor: pointer;
    font-weight: 400;
}

.dropzone-label strong {
    color: var(--accent);
    font-size: 15px;
}

.dropzone-label span {
    color: var(--ink-3);
    font-size: 13px;
}

.file-list {
    margin: 0;
    padding: 0 8px 8px;
    list-style: none;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.file-item + .file-item { margin-top: 8px; }

.file-thumb {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    background: #eef0f3;
}

.file-thumb-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.file-meta {
    flex: 1 1 auto;
    min-width: 0;
}

.file-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    display: block;
    color: var(--ink-3);
    font-size: 12.5px;
}

.file-size.is-warning { color: #a76a00; }

.file-remove {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: #fff;
    color: var(--ink-2);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.file-remove:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* --- Відправка --- */

.submit-row {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.submit-note {
    margin: 0;
    flex: 1 1 260px;
    color: var(--ink-3);
    font-size: 13px;
}

.progress { margin-top: 18px; }

.progress-bar {
    height: 6px;
    border-radius: 4px;
    background: var(--line);
    overflow: hidden;
}

.progress-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent);
    transition: width .2s ease;
}

.progress-text {
    margin: 8px 0 0;
    color: var(--ink-2);
    font-size: 13.5px;
}

.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* --- Фінальний екран --- */

.success {
    margin: 56px 0 32px;
    padding: 40px 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
}

.success-check {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: rgba(26, 127, 75, .1);
    color: var(--ok);
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success h1 { font-size: 24px; }

.success p {
    margin: 0 auto 12px;
    max-width: 520px;
    color: var(--ink-2);
}

.success-note {
    font-size: 14px;
    color: var(--ink-3) !important;
}

.success .btn { margin-top: 12px; }

@media (max-width: 600px) {
    .intro { padding-top: 28px; }
    h1 { font-size: 23px; }
    .steps, .block { padding: 18px 16px; }
    .btn-primary { width: 100%; }
    .submit-row { gap: 12px; }
}
