* {
    box-sizing: border-box;
}

:root {
    --primary: #0073e6;
    --primary-dark: #005bb8;
    --primary-soft: #eef6ff;
    --text: #1f2937;
    --muted: #667085;
    --border: #d7dee8;
    --background: #f5f8fc;
    --white: #ffffff;
    --danger: #b42318;
    --success: #027a48;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(0,115,230,.08), transparent 32%),
        var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.55;
}

.page-shell {
    padding: 28px 14px 50px;
}

.card {
    width: min(980px, 100%);
    margin: 0 auto;
    background: var(--white);
    border: 1px solid rgba(0, 115, 230, .12);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 55px rgba(15, 55, 95, .12);
}

.site-header {
    text-align: center;
    padding: 28px 24px 24px;
    border-top: 8px solid var(--primary);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.logo {
    width: 200px;
    height: 200px;
    object-fit: contain;
    display: block;
    margin: 0 auto 6px;
}

.site-header h1 {
    margin: 0;
    color: var(--primary);
    font-size: clamp(28px, 5vw, 42px);
    line-height: 1.15;
    letter-spacing: -.5px;
}

.subtitle {
    margin: 9px auto 0;
    max-width: 720px;
    color: var(--muted);
    font-size: 15px;
}

form {
    padding: 0 28px 30px;
}

.form-section {
    padding: 30px 0;
    border-top: 1px solid #e8edf3;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.section-title > span {
    min-width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.section-title h2 {
    margin: 0;
    color: var(--primary);
    font-size: 23px;
}

.grid {
    display: grid;
    gap: 18px;
}

.two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.field label,
.signature-box > label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
}

strong {
    color: var(--primary);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
    padding: 12px 13px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

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

input:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 115, 230, .11);
}

.question {
    margin: 0 0 15px;
    padding: 16px 18px;
    background: #fbfdff;
    border: 1px solid #e3eaf2;
    border-radius: 12px;
}

.question p {
    margin: 0 0 12px;
    font-weight: 700;
}

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

.choice-row label {
    cursor: pointer;
}

.choice-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-row span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    min-height: 40px;
    padding: 9px 15px;
    border: 1px solid #b9c6d6;
    border-radius: 999px;
    background: #fff;
    color: #445264;
    font-weight: 700;
    transition: all .2s ease;
}

.choice-row input:checked + span {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 6px 16px rgba(0,115,230,.18);
}

.large-choice {
    margin-bottom: 22px;
}

.large-choice span {
    min-width: 150px;
}

.declaration {
    background: var(--primary-soft);
    margin-left: -28px;
    margin-right: -28px;
    padding-left: 28px;
    padding-right: 28px;
}

.signature-box {
    margin-top: 20px;
}

#signaturePad {
    display: block;
    width: 100%;
    height: 220px;
    border: 2px dashed #94a3b8;
    border-radius: 12px;
    background: #fff;
    touch-action: none;
    cursor: crosshair;
}

.signature-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.secondary-btn,
.submit-btn {
    appearance: none;
    border: 0;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}

.secondary-btn {
    padding: 9px 14px;
    background: #e9eef5;
    color: #344054;
}

.secondary-btn:hover {
    background: #dce4ee;
}

.submit-btn {
    width: 100%;
    padding: 16px 18px;
    background: var(--primary);
    color: white;
    font-size: 17px;
    letter-spacing: .3px;
    box-shadow: 0 10px 24px rgba(0,115,230,.23);
}

.submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: .6;
    cursor: wait;
    transform: none;
}

.help,
.form-note {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.legal-text {
    padding: 19px;
    max-height: 520px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fbfcfe;
    font-size: 14px;
}

.legal-text h3 {
    color: var(--primary);
    margin-top: 21px;
    margin-bottom: 7px;
}

.legal-text p:first-child {
    margin-top: 0;
}

.check-line {
    margin-top: 18px;
    padding: 15px;
    border: 1px solid #d8e1ec;
    border-radius: 11px;
    background: #fff;
}

.check-line label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.check-line input {
    width: 19px;
    height: 19px;
    margin-top: 2px;
    accent-color: var(--primary);
}

.image-consent {
    margin-top: 18px;
}

.legal-binding {
    background: var(--primary-soft);
    border-color: rgba(0,115,230,.25);
    margin-bottom: 18px;
}

.alert {
    margin: 22px 28px 0;
    padding: 13px 15px;
    border-radius: 10px;
    font-weight: 700;
}

.alert.success {
    color: var(--success);
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.alert.error {
    color: var(--danger);
    background: #fef3f2;
    border: 1px solid #fecdca;
}

.invalid {
    outline: 2px solid #f04438 !important;
    outline-offset: 2px;
}

@media (max-width: 700px) {
    .page-shell {
        padding: 0;
    }

    .card {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .site-header {
        padding: 20px 16px;
    }

    .logo {
        width: 160px;
        height: 160px;
    }

    form {
        padding: 0 17px 24px;
    }

    .declaration {
        margin-left: -17px;
        margin-right: -17px;
        padding-left: 17px;
        padding-right: 17px;
    }

    .two-cols {
        grid-template-columns: 1fr;
    }

    .full {
        grid-column: auto;
    }

    .section-title h2 {
        font-size: 20px;
    }

    #signaturePad {
        height: 190px;
    }
}
