#diylaw-form-wrap {
    max-width: 680px;
    margin: 0 auto;
    font-family: inherit;
}

/* ── Progress bar ─────────────────────────────────────────────────────────── */

.diylaw-progress {
    margin-bottom: 28px;
}

.diylaw-progress-label {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 6px;
}

.diylaw-progress-track {
    height: 6px;
    background: #e5e5e5;
    border-radius: 3px;
    overflow: hidden;
}

.diylaw-progress-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ── Fieldset / step ──────────────────────────────────────────────────────── */

.diylaw-step {
    border: none;
    padding: 0;
    margin: 0;
}

.diylaw-step legend {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 6px;
    padding: 0;
}

.diylaw-step-desc {
    color: #555;
    margin-bottom: 24px;
    font-size: 0.9375rem;
}

/* ── Sub-fieldset ─────────────────────────────────────────────────────────── */

.diylaw-sub-fieldset {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.diylaw-sub-fieldset legend {
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 0 4px;
    color: #374151;
}

/* ── Fields ───────────────────────────────────────────────────────────────── */

.diylaw-field {
    margin-bottom: 18px;
}

.diylaw-field label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 0.9375rem;
}

.diylaw-field .req {
    color: #dc2626;
}

.diylaw-field input[type="text"],
.diylaw-field input[type="email"],
.diylaw-field input[type="tel"],
.diylaw-field input[type="number"],
.diylaw-field input[type="date"],
.diylaw-field select,
.diylaw-field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.diylaw-field input[readonly] {
    background: #f9fafb;
    color: #6b7280;
    cursor: default;
}

.diylaw-field input:focus,
.diylaw-field select:focus,
.diylaw-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* Two-column field row */
.diylaw-field-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.diylaw-field-row .diylaw-field {
    flex: 1 1 160px;
}

.diylaw-field-row .diylaw-field.diylaw-field-narrow {
    flex: 0 0 100px;
}

.diylaw-field-row .diylaw-field.diylaw-field-wide {
    flex: 2 1 200px;
}

/* Hint text */
.diylaw-hint {
    display: block;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 4px;
}

/* ── Radio groups ─────────────────────────────────────────────────────────── */

.diylaw-radio-group {
    display: flex;
    gap: 24px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.diylaw-radio-group label {
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* ── Checkbox groups ──────────────────────────────────────────────────────── */

.diylaw-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.diylaw-checkbox-group label {
    font-weight: 400;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    line-height: 1.4;
}

.diylaw-checkbox-group input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

/* ── Validation errors ────────────────────────────────────────────────────── */

.diylaw-field-error {
    display: block;
    color: #dc2626;
    font-size: 0.8125rem;
    margin-top: 4px;
}

.diylaw-error-msg {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 5px;
    color: #dc2626;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.9375rem;
}

.diylaw-error-box {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 5px;
    color: #dc2626;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.9375rem;
}

/* ── Notices ──────────────────────────────────────────────────────────────── */

.diylaw-notice {
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.9375rem;
}

.diylaw-notice-ok {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
}

.diylaw-notice-warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

/* ── TEST MODE banner ─────────────────────────────────────────────────────── */

.diylaw-test-banner {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 6px;
    color: #78350f;
    font-size: 0.9375rem;
    padding: 10px 16px;
    margin-bottom: 20px;
    text-align: center;
}

/* ── OTP input ────────────────────────────────────────────────────────────── */

.diylaw-otp-input {
    letter-spacing: 0.3em;
    font-size: 1.5rem !important;
    text-align: center;
    max-width: 180px;
}

/* ── Review step ──────────────────────────────────────────────────────────── */

.diylaw-review {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.diylaw-review-section {
    margin-bottom: 20px;
}

.diylaw-review-section:last-child {
    margin-bottom: 0;
}

.diylaw-review-section h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin: 0 0 10px;
}

.diylaw-review-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.diylaw-review-table th,
.diylaw-review-table td {
    padding: 6px 0;
    text-align: left;
    vertical-align: top;
}

.diylaw-review-table th {
    width: 38%;
    color: #6b7280;
    font-weight: 500;
}

/* ── Pre-payment info page ────────────────────────────────────────────────── */

.diylaw-intro {
    color: #374151;
    margin-bottom: 20px;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.diylaw-service-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.diylaw-service-box h3 {
    font-size: 1rem;
    margin: 0 0 10px;
}

.diylaw-service-box ul {
    margin: 0;
    padding: 0 0 0 20px;
    font-size: 0.9375rem;
    color: #374151;
}

.diylaw-service-box ul li {
    margin-bottom: 4px;
}

.diylaw-fee-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    text-align: center;
}

.diylaw-fee-amount {
    font-size: 2rem;
    font-weight: 700;
    color: #1d4ed8;
    line-height: 1;
    margin-bottom: 4px;
}

.diylaw-fee-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.diylaw-secure-note {
    font-size: 0.8125rem;
    color: #6b7280;
    text-align: center;
    margin-top: 12px;
}

.diylaw-small {
    font-size: 0.8125rem;
    color: #6b7280;
}

/* ── Payment box (legacy + submit) ───────────────────────────────────────── */

.diylaw-payment-box,
.diylaw-submit-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.diylaw-payment-box p,
.diylaw-submit-box p {
    margin: 0 0 6px;
    font-size: 0.9375rem;
}

.diylaw-payment-box p:last-child,
.diylaw-submit-box p:last-child {
    margin-bottom: 0;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.diylaw-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.diylaw-actions-top-margin {
    margin-top: 12px;
}

.diylaw-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    display: inline-block;
}

.diylaw-btn:hover {
    background: #1d4ed8;
    color: #fff;
}

.diylaw-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.diylaw-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.diylaw-btn-secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

.diylaw-btn-pay,
.diylaw-btn-submit {
    background: #16a34a;
    flex: 1;
    text-align: center;
}

.diylaw-btn-pay:hover,
.diylaw-btn-submit:hover {
    background: #15803d;
}

.diylaw-btn-sm {
    padding: 6px 14px;
    font-size: 0.875rem;
}

.diylaw-btn-text {
    background: none;
    color: #2563eb;
    border: none;
    padding: 10px 8px;
    font-size: 0.9375rem;
    text-decoration: underline;
}

.diylaw-btn-text:hover {
    background: none;
    color: #1d4ed8;
}

/* ── Repeater rows (children / assets) ───────────────────────────────────── */

.diylaw-repeater {
    margin-bottom: 16px;
}

.diylaw-repeater-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 12px;
    color: #374151;
}

.diylaw-repeater-row {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.diylaw-repeater-row-label {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 10px;
}

/* ── Conditional fields ───────────────────────────────────────────────────── */

.diylaw-conditional {
    border-left: 3px solid #e5e7eb;
    padding-left: 16px;
    margin-top: 8px;
    margin-bottom: 4px;
}

/* ── Pension / maintenance party sections ─────────────────────────────────── */

.diylaw-pension-party,
.diylaw-maintenance-party {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.diylaw-pension-party:last-child,
.diylaw-maintenance-party:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.diylaw-pension-party h3,
.diylaw-maintenance-party h3 {
    font-size: 1rem;
    margin: 0 0 14px;
    color: #1f2937;
}

.diylaw-fund-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed #e5e7eb;
}

.diylaw-fund-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* ── Court citation ───────────────────────────────────────────────────────── */

.diylaw-court-citation {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.9375rem;
}

.diylaw-court-citation label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
    font-size: 0.875rem;
}

.diylaw-court-citation p {
    margin: 0;
    line-height: 1.6;
    color: #1d4ed8;
    font-style: italic;
}

/* ── Waiting / polling page ───────────────────────────────────────────────── */

.diylaw-waiting-wrap {
    text-align: center;
    padding: 40px 20px;
}

.diylaw-waiting-state {
    padding: 40px 0;
}

.diylaw-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: diylaw-spin 0.9s linear infinite;
    margin: 0 auto 20px;
}

@keyframes diylaw-spin {
    to { transform: rotate(360deg); }
}

.diylaw-waiting-icon {
    font-size: 3rem;
    line-height: 1;
    margin: 0 auto 16px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diylaw-icon-success {
    background: #dcfce7;
    color: #16a34a;
}

.diylaw-icon-fail {
    background: #fef2f2;
    color: #dc2626;
}

/* ── Qualification questions ──────────────────────────────────────────────── */

.diylaw-qualify-intro {
    font-size: 1.05rem;
    margin-bottom: 20px;
}

.diylaw-qualify-question {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e5e7eb;
}

.diylaw-qualify-question:last-of-type,
.diylaw-qualify-legal {
    border-bottom: none;
}

.diylaw-question-label {
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    color: #c0392b !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0 0 10px !important;
}

.diylaw-question-text {
    font-weight: 600 !important;
    font-size: 0.9375rem !important;
    margin: 0 0 8px !important;
}

.diylaw-required {
    color: #c0392b;
}

.diylaw-radio-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.diylaw-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.diylaw-legal-links {
    margin: 0 0 4px;
}

.diylaw-legal-links a {
    color: inherit;
    text-decoration: underline;
}

.diylaw-qualify-terms {
    margin: 12px 0 20px;
}

.diylaw-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.diylaw-question-bullets {
    list-style: disc;
    padding-left: 20px;
    margin: 0 0 12px;
}

.diylaw-question-bullets li {
    margin-bottom: 4px;
    font-size: 0.9375rem;
}

.diylaw-q-conditional {
    animation: diylaw-fadein 0.25s ease;
}

@keyframes diylaw-fadein {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Lost-link page ───────────────────────────────────────────────────────── */

.diylaw-lost-link-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 0;
}

/* ── Success message ──────────────────────────────────────────────────────── */

.diylaw-success-msg {
    text-align: center;
    padding: 40px 20px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 540px) {
    .diylaw-field-row {
        flex-direction: column;
        gap: 0;
    }

    .diylaw-field-row .diylaw-field.diylaw-field-narrow {
        flex: 1 1 auto;
    }

    .diylaw-radio-group {
        flex-direction: column;
        gap: 10px;
    }
}
