/* ==========================================
   MODERN SAAS-STYLE WIZARD CSS
   Centered, responsive, clean
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f5f7fc 0%, #eef2f7 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    color: #1e293b;
    padding: 2rem 1rem;
    min-height: 100vh;
}

.wizard-container {
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
}

.wizard-step {
    background: #ffffff;
    border-radius: 32px;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.02);
    padding: 2rem 1.75rem;
    transition: box-shadow 0.2s ease;
}

.wizard-step:hover {
    box-shadow: 0 24px 42px -14px rgba(0, 0, 0, 0.12);
}

.wizard-step h3 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #0f172a;
    letter-spacing: -0.01em;
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
}

.wizard-step h4 {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 1.5rem 0 0.75rem 0;
    color: #334155;
}

.mb-3, .mb-2 {
    margin-bottom: 1.25rem !important;
}

label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
    color: #1e293b;
    font-size: 0.9rem;
}

input, select, textarea, .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #0f172a;
    background-color: #ffffff;
    background-clip: padding-box;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus, .form-control:focus {
    border-color: #3b82f6;
    outline: 0;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* ========== FIXED COUNTY DROPDOWN (DATALIST) ========== */
.wizard-step .mb-3:has(input[list]) {
    position: relative;
}

input[list] {
    width: 100%;
    display: block;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%2364748b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
}

datalist {
    position: absolute;
    left: 0;
    top: calc(100% + 4px);
    width: 100%;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

datalist option {
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
}

datalist option:hover {
    background-color: #eff6ff;
}
/* ==================================================== */

/* ========== FIXED CHECKBOX & RADIO ALIGNMENT (Bootstrap override) ========== */
.wizard-step .form-check {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    margin-bottom: 0.75rem !important;
    padding-left: 0 !important;      /* Remove Bootstrap's left padding */
}

.wizard-step .form-check-input {
    margin-top: 0.2rem !important;
    flex-shrink: 0 !important;
    float: none !important;          /* Override Bootstrap's float */
    margin-left: 0 !important;
}

.wizard-step .form-check-label {
    font-weight: normal !important;
    margin: 0 !important;
    font-size: 1rem !important;
    line-height: 1.4 !important;
}

/* Small description under add‑on titles */
.wizard-step .form-check small {
    display: block;
    margin-left: 0;
    margin-top: 0.25rem;
    color: #6c757d;
}
/* ======================================================================== */

.text-muted, small.text-muted {
    font-size: 0.75rem;
    color: #64748b !important;
    display: block;
    margin-top: 0.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 40px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
    gap: 0.5rem;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -8px #3b82f6;
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #1e293b;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: #fee2e2;
    color: #b91c1c;
    border: none;
}

.btn-danger:hover {
    background-color: #fecaca;
}

.remove-child, .remove-creditor, .remove-payment {
    margin-top: 0.5rem;
    width: auto;
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
}

#children-container, #creditors-container, #monthly-payments-container {
    margin-bottom: 1rem;
}

.child-entry, .creditor-entry, .payment-entry {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
}

#add-child, #add-creditor, #add-payment {
    background: white;
    border: 1px dashed #3b82f6;
    color: #3b82f6;
    padding: 0.5rem 1rem;
    border-radius: 40px;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

#add-child:hover, #add-creditor:hover, #add-payment:hover {
    background: #eff6ff;
    border: 1px solid #3b82f6;
}

@media (max-width: 768px) {
    body {
        padding: 1rem 0.75rem;
    }
    .wizard-step {
        padding: 1.5rem;
        border-radius: 24px;
    }
    .wizard-step h3 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }
    .btn {
        padding: 0.5rem 1.25rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .wizard-step {
        padding: 1.25rem;
    }
    .wizard-step .form-check {
        gap: 0.5rem;
    }
    datalist option {
        padding: 6px 12px;
    }
}