/* === White theme form CSS === */
:root {
    --bg: #ffffff;
    --fg: #222222;
    --muted: #555555;
    --card: #ffffff;
    --line: #dddddd;
    --accent: #0066cc;
    --focus: #3399ff;
    --req: #d92d20;
}

/* Form layout */
form {
    display: grid;
    gap: 3.5rem;
    padding: 4rem 2rem;
}

section.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

section.card h2 {
    margin: 0 0 12px;
    font-size: 18px;
    color: var(--fg);
}

form .grid {
    display: grid;
    gap: 16px;
}

@media (min-width: 768px) {
    form .grid.cols-2 {
        grid-template-columns: 1fr 1fr;
    }

    form .grid.cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Labels & helpers */
label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 6px;
}

.helper {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

/* Inputs & textareas */
form input[type="text"],
form input[type="email"],
form input[type="tel"],
form input[type="date"],
form textarea,
form select {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--fg);
    border-radius: 6px;
    padding: 10px 12px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(51, 153, 255, 0.15);
}

/* Radio / Checkbox groups */
.radio-group,
.checkbox-group {
    display: grid;
    gap: 10px;
}

.radio-group {
    margin-bottom: 16px;
}

.radio-group label {
    margin-bottom: 0;
}

.option-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Chip style option */
.chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    background: #f7f7f7;
    border: 1px solid var(--line);
    color: var(--fg);
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
}

.chip:hover {
    background: #f0f8ff;
    border-color: var(--focus);
}

.chip>input {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 2px solid #888;
    border-radius: 50%;
    background: transparent;
    display: inline-block;
    position: relative;
}

.chip>input:checked {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 4px var(--accent);
}

/* Signature area */
.signature {
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 6px;
    height: 150px;
    cursor: crosshair;
    touch-action: none;
}

.sig-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

/* Buttons */
.btn {
    background: #f7f7f7;
    color: var(--fg);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, transform 80ms ease;
}

.btn:hover {
    background: #f0f8ff;
    border-color: var(--focus);
}

.btn:active {
    transform: translateY(1px);
}

.btn.primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn.primary:hover {
    background: var(--focus);
}

/* Form actions */
.actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

/* Print-friendly */
@media print {
    .actions {
        display: none !important;
    }

    section.card {
        border-color: #ccc;
        box-shadow: none;
    }

    input,
    textarea,
    select {
        background: #fff;
        color: #000;
        border-color: #bbb;
    }
}


label:has(+ input[required])::after,
label:has(+ select[required])::after,
label:has(+ textarea[required])::after {
    content: " *";
    color: var(--req);
    margin-left: 4px;
    font-weight: 600;
}

/* Radio/checkbox groups: label followed by an option-row that contains required inputs */
.radio-group>label:has(+ .option-row input[required])::after,
.checkbox-group>label:has(+ .option-row input[required])::after {
    content: " *";
    color: var(--req);
    margin-left: 4px;
    font-weight: 600;
}

.signature{
  background:#fff;
  border:1px dashed #ddd;
  border-radius:6px;
  height:160px; /* controls visual height; JS scales pixels */
  cursor:crosshair;
  touch-action:none;
}
