:root {
    --ink: #202124;
    --muted: #666a70;
    --line: #d9dadd;
    --soft: #f5f5f6;
    --accent: #ef2b2d;
    --accent-dark: #c91d20;
    --white: #fff;
    --navy: #0b2c88;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #eeeeef;
    color: var(--ink);
    font-family: 'Poppins', Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

button, input, textarea { font: inherit; }

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 44px auto;
}

.form-card {
    background: var(--white);
    border-radius: 18px;
    box-shadow: 0 16px 50px rgba(0,0,0,.08);
    overflow: hidden;
}

.form-header {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: center;
    padding: 42px;
    border-bottom: 1px solid var(--line);
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.brand-mark img {
    display: block;
    width: 100%;
    max-width: 220px;
    height: auto;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 13px;
}

h1 { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.05; }
.lead { max-width: 760px; margin: 14px 0 0; color: var(--muted); font-size: 17px; }

form { padding: 12px 42px 24px; }

fieldset {
    border: 0;
    margin: 0;
    padding: 34px 0;
    border-bottom: 1px solid var(--line);
}

legend {
    padding: 0;
    font-size: 22px;
    font-weight: 800;
}

.optional { color: var(--muted); font-size: 14px; font-weight: 500; }
.hint { margin: 7px 0 18px; color: var(--muted); }

.partner-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.full { grid-column: 1 / -1; }


.logo-upload-field { margin-top: 4px; }
.file-upload {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 86px;
    padding: 15px 16px;
    border: 1px dashed #b9bdc5;
    border-radius: 10px;
    background: #fafafb;
}
.file-upload input[type="file"] {
    width: min(320px, 100%);
    font-size: 13px;
}
.file-upload-copy strong, .file-upload-copy span { display: block; }
.file-upload-copy strong { font-size: 13px; }
.file-upload-copy span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.logo-preview {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}
.logo-preview[hidden] { display: none; }
.logo-preview img {
    width: 120px;
    height: 72px;
    object-fit: contain;
    border: 1px solid #eceef0;
    border-radius: 8px;
    background: #fff;
}
.logo-remove {
    border: 0;
    border-radius: 8px;
    padding: 8px 12px;
    background: #eceef1;
    color: var(--ink);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

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

.date-option, .radio-option {
    position: relative;
    cursor: pointer;
}

.date-option input, .radio-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.date-option span, .radio-option span {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font-weight: 700;
    text-align: center;
    transition: .18s ease;
}

.date-option input:checked + span,
.radio-option input:checked + span {
    color: #fff;
    background: var(--navy);
    border-color: var(--navy);
}

.date-option input:focus-visible + span,
.radio-option input:focus-visible + span,
input:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(11,44,136,.22);
    outline-offset: 2px;
}

.field-error { min-height: 20px; margin: 10px 0 0; color: var(--accent-dark); font-weight: 700; font-size: 14px; }

.section-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
}

.products { display: grid; gap: 12px; }

.product-row {
    display: grid;
    grid-template-columns: minmax(250px, 1.7fr) minmax(150px, .75fr) minmax(150px, .75fr) 42px;
    gap: 12px;
    align-items: end;
    padding: 16px;
    background: var(--soft);
    border-radius: 12px;
}

.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 700; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #c9cbd0;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
}

textarea { resize: vertical; min-height: 110px; }
input:invalid:not(:placeholder-shown), textarea:invalid:not(:placeholder-shown) { border-color: var(--accent); }

.money-input { position: relative; }
.money-input input { padding-right: 42px; }
.money-input span {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.is-readonly input { background: #ececee; color: #4d4f54; }

.remove-product {
    width: 42px;
    height: 46px;
    border: 0;
    border-radius: 8px;
    background: #e4e4e6;
    cursor: pointer;
    font-size: 25px;
    line-height: 1;
}
.remove-product:hover { background: #d8d8da; }

.radio-group { display: flex; gap: 10px; width: min(350px, 100%); }
.radio-option { flex: 1; }

.voucher-fields {
    margin-top: 18px;
    padding: 18px;
    border-radius: 12px;
    background: var(--soft);
}
.voucher-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }

.button {
    min-height: 46px;
    padding: 11px 18px;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 800;
}
.button-primary { background: var(--accent); color: #fff; padding-inline: 26px; }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { background: #202124; color: #fff; white-space: nowrap; }

.actions { display: flex; justify-content: flex-end; padding-top: 22px; }

.form-footer {
    padding: 18px 42px 28px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 900px) {
    .form-header { grid-template-columns: 1fr; }
    .brand-mark { justify-content: flex-start; }
    .brand-mark img { max-width: 210px; }
    .date-grid { grid-template-columns: repeat(2, 1fr); }
    .product-row { grid-template-columns: 1fr 1fr; }
    .field-name { grid-column: 1 / -1; }
    .remove-product { grid-column: 2; justify-self: end; }
    .section-heading-row { display: grid; }
    .section-heading-row .button { justify-self: start; }
}

@media (max-width: 620px) {
    .page-shell { width: 100%; margin: 0; }
    .form-card { border-radius: 0; }
    .form-header, form, .form-footer { padding-left: 20px; padding-right: 20px; }
    .partner-grid, .date-grid, .voucher-grid, .product-row { grid-template-columns: 1fr; }
    .file-upload { align-items: flex-start; flex-direction: column; }
    .field-name, .remove-product, .full { grid-column: auto; }
    .remove-product { justify-self: end; }
}

/* Ekran podziękowania */
.thank-you-shell {
    width: min(820px, calc(100% - 32px));
    min-height: calc(100vh - 88px);
    display: flex;
    align-items: center;
}

.thank-you-card { width: 100%; }

.thank-you-header {
    padding: 34px 42px 12px;
    text-align: center;
}

.thank-you-logo {
    display: inline-block;
    width: 190px;
    max-width: 60%;
    height: auto;
}

.thank-you-content {
    padding: 18px 42px 42px;
    text-align: center;
}

.success-mark {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #0b2c88;
    color: #fff;
    font-size: 38px;
    font-weight: 800;
}

.thank-you-content .eyebrow { margin-bottom: 8px; }
.thank-you-content h1 { font-size: clamp(32px, 6vw, 52px); }

.thank-you-lead {
    max-width: 650px;
    margin: 18px auto 0;
    color: var(--ink);
    font-size: 18px;
}

.thank-you-text {
    max-width: 620px;
    margin: 12px auto 0;
    color: var(--muted);
}

.thank-you-actions {
    margin-top: 28px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.thank-you-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.button-light {
    background: #ececee;
    color: var(--ink);
}

.button-light:hover {
    background: #dedee1;
    text-decoration: none;
}

@media (max-width: 620px) {
    .thank-you-shell { min-height: 100vh; }
    .thank-you-header { padding: 28px 20px 8px; }
    .thank-you-content { padding: 18px 20px 34px; }
    .thank-you-actions { display: grid; }
}
