/* ─────────────────────────────────────────────────────────────────────────────
   STAT Forms V2 – Public Form Styles
   ───────────────────────────────────────────────────────────────────────────── */

.sfvt-form-wrap { max-width: 800px; margin: 0 auto; font-family: inherit; }
.sfvt-form { padding: 0; }

/* Fields grid */
.sfvt-fields-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 16px;
}

/* Width variants */
.sfvt-field-full    { width: 100%; }
.sfvt-field-half    { width: calc(50% - 8px); }
.sfvt-field-quarter { width: calc(25% - 12px); }
.sfvt-field-third   { width: calc(33.333% - 11px); }

@media (max-width: 600px) {
    .sfvt-field-half,
    .sfvt-field-quarter,
    .sfvt-field-third { width: 100%; }
}

/* Label */
.sfvt-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
}
.sfvt-required { color: #d00; margin-left: 2px; }

/* Inputs */
.sfvt-field-wrap input[type=text],
.sfvt-field-wrap input[type=email],
.sfvt-field-wrap input[type=tel],
.sfvt-field-wrap input[type=number],
.sfvt-field-wrap input[type=date],
.sfvt-field-wrap input[type=url],
.sfvt-field-wrap select,
.sfvt-field-wrap textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    color: #222;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
}
.sfvt-field-wrap input:focus,
.sfvt-field-wrap select:focus,
.sfvt-field-wrap textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34,113,177,.12);
}
.sfvt-field-wrap textarea { resize: vertical; min-height: 100px; }
.sfvt-field-wrap select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M6 8L0 0h12z' fill='%23666'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

/* Name field */
.sfvt-name-wrap { display: flex; gap: 12px; }
.sfvt-name-sub { flex: 1; }

/* Address */
.sfvt-address-wrap { display: flex; flex-direction: column; gap: 8px; }

/* Sublabels */
.sfvt-sublabel { display: block; font-size: 11px; color: #888; margin-top: 3px; }

/* Radio / Checkbox */
.sfvt-radio-wrap, .sfvt-checkbox-wrap { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 4px; }
.sfvt-radio-label, .sfvt-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}
.sfvt-radio-label input, .sfvt-checkbox-label input { cursor: pointer; width: auto; }

/* Headings / Paragraph / Divider — always full width regardless of field width setting */
.sfvt-type-heading,
.sfvt-type-paragraph,
.sfvt-type-divider { width: 100% !important; }
.sfvt-type-heading .sfvt-heading { margin: 0; padding: 0; }
.sfvt-type-heading h1 { font-size: 22px; font-weight: 700; text-align: center; }
.sfvt-type-heading h2 { font-size: 17px; font-weight: 700; border-bottom: 2px solid #333; padding-bottom: 4px; }
.sfvt-type-heading h3 { font-size: 15px; font-weight: 600; }
.sfvt-type-paragraph .sfvt-paragraph { font-size: 13px; color: #555; margin: 0; line-height: 1.6; }
.sfvt-divider { border: none; border-top: 1px solid #e0e0e0; margin: 4px 0; }

/* File upload */
.sfvt-field-wrap input[type=file] { display: block; width: 100%; font-size: 14px; }

/* Field description */
.sfvt-field-desc { font-size: 12px; color: #888; margin: 3px 0 0; }

/* Signature */
.sfvt-signature-wrap { display: block; position: relative; width: 100%; }
.sfvt-signature-canvas {
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: crosshair;
    display: block;
    width: 100%;
    height: 150px;
    touch-action: none;
    box-sizing: border-box;
}
.sfvt-sig-clear {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #555;
    background: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px 8px;
    cursor: pointer;
}
.sfvt-sig-clear:hover { background: #f5f5f5; }

/* Submit */
.sfvt-submit-wrap { margin-top: 20px; }
.sfvt-submit-btn {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 11px 30px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.sfvt-submit-btn:hover { background: #135e96; }
.sfvt-submit-btn:active { transform: scale(.98); }
.sfvt-submit-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Messages */
.sfvt-form-messages { margin-bottom: 12px; }
.sfvt-form-messages .sfvt-success {
    background: #edfaef;
    border-left: 4px solid #00a32a;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    color: #063;
}
.sfvt-form-messages .sfvt-form-error {
    background: #fef7f7;
    border-left: 4px solid #d63638;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    color: #800;
}
.sfvt-pdf-download-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #2271b1;
    color: #2271b1;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    font-weight: 600;
}
.sfvt-pdf-download-link:hover { background: #f0f6ff; }

/* Field errors */
.sfvt-error-msg { font-size: 12px; color: #d63638; margin-top: 3px; min-height: 16px; }
.sfvt-field-wrap.has-error input,
.sfvt-field-wrap.has-error select,
.sfvt-field-wrap.has-error textarea { border-color: #d63638; }

/* Loading spinner */
.sfvt-submit-btn.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sfvt-spin .7s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}
@keyframes sfvt-spin { to { transform: rotate(360deg); } }
