@font-face {
    font-family: 'NRT-Kurdish';
    src: url('NRT-Bd.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg-primary: #0b111e;
    --bg-secondary: #131c2e;
    --bg-card: #1b263b;
    --bg-input: #111928;
    
    --primary: #10b981;
    --primary-hover: #059669;
    --primary-light: rgba(16, 185, 129, 0.1);
    
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --border: #374151;
    --border-focus: #10b981;
    --border-error: #ef4444;
    
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    
    --font-sans: 'NRT-Kurdish', 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.7);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Container & Layout */
.container {
    width: 100%;
    max-width: 800px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Banner */
.header-banner {
    position: relative;
    background-image: url('banner.jpg');
    background-size: cover;
    background-position: center;
    width: 100%;
    aspect-ratio: 800/250;
    min-height: 140px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.header-banner * {
    display: none !important;
}

/* Progress Tracker */
.progress-bar-container {
    display: flex;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    justify-content: space-around;
    overflow-x: auto;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.progress-step.active {
    color: var(--primary);
    background: var(--primary-light);
}

.progress-step.completed {
    color: var(--text-primary);
}

.progress-step.completed .step-num {
    background: var(--primary);
    color: var(--bg-primary);
}

.step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.progress-step.active .step-num {
    background: var(--primary);
    color: var(--bg-primary);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* Form Styling */
form {
    padding: 2.5rem 2rem;
}

/* Form Sections */
.form-section {
    display: block;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2.5rem;
}

#section-4 {
    display: none; /* Conditional driver 2 section */
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 1rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Form Fields Layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* Labels & Inputs */
label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

label .required-star {
    color: var(--error);
    margin-left: 4px;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Invalid / Error States */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: var(--border-error) !important;
    background-color: rgba(239, 68, 68, 0.02);
}

.error-message {
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 0.25rem;
    display: none;
    align-items: center;
    gap: 0.25rem;
    animation: errFade 0.2s ease;
}

@keyframes errFade {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group.has-error .error-message {
    display: flex;
}

/* Date Field / Format Visual Helpers */
.date-container {
    position: relative;
}

/* Radio buttons / Single Choice Card Elements */
.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-card {
    flex: 1;
    min-width: 120px;
    position: relative;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-align: center;
}

.radio-card input[type="radio"]:checked + label {
    border-color: var(--primary);
    background-color: var(--primary-light);
    color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.radio-card:hover label {
    border-color: var(--text-muted);
}

/* Nested Dynamic Cards (ABCD and ABCDF) */
.nested-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border);
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.dynamic-card {
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    position: relative;
    animation: slideIn 0.3s ease;
}

.dynamic-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.dynamic-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-remove {
    background: transparent;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.btn-remove:hover {
    background-color: var(--error-bg);
}

/* Conditional Containers */
.conditional-block {
    display: none;
    grid-column: 1 / -1;
    background-color: rgba(255, 255, 255, 0.02);
    border-right: 3px solid var(--primary);
    border-left: none;
    padding: 1rem;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
    animation: slideIn 0.25s ease;
}

.conditional-block.visible {
    display: grid;
}

/* Footer / Navigation Buttons */
.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    gap: 1rem;
}

.btn {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-normal);
    user-select: none;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-primary {
    background-color: var(--primary);
    border: 1px solid var(--primary);
    color: #0b111e;
    flex-grow: 1;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

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

/* Terms Checkbox */
.terms-container {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background-color: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.terms-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    margin-top: 0.15rem;
}

.terms-container label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.terms-container label a {
    color: var(--primary);
    text-decoration: none;
}

.terms-container label a:hover {
    text-decoration: underline;
}

/* Dynamic Add Button */
.btn-add-dynamic {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px dashed var(--primary);
    color: var(--primary);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
    width: 100%;
    margin-top: 0.5rem;
}

.btn-add-dynamic:hover {
    background-color: var(--primary);
    color: #0b111e;
}

/* Success Overlay */
.success-screen {
    display: none;
    text-align: center;
    padding: 4rem 2rem;
    animation: fadeIn 0.5s ease;
}

.success-screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    background-color: var(--primary-light);
    border-radius: 50%;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.success-screen h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.success-screen p {
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 2rem;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    body {
        padding: 0.5rem;
    }
    
    .container {
        border-radius: var(--radius-md);
    }
    
    .header-banner {
        padding: 2rem 1rem;
    }
    
    .header-banner h1 {
        font-size: 1.75rem;
    }
    
    form {
        padding: 1.5rem 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .conditional-block {
        grid-column: span 1;
    }
    
    .nested-container {
        grid-column: span 1;
        padding: 1rem;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .radio-card {
        width: 100%;
    }
    
    .form-footer {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .btn-secondary {
        order: 2; /* Previous button goes bottom on mobile */
    }
    .btn-primary {
        order: 1; /* Next/Submit button goes top on mobile */
    }
}

/* Custom Three-Part Date Input Components */
.date-input {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    box-sizing: border-box;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    width: 100%;
}

.date-input:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.date-input.error {
    border-color: var(--border-error) !important;
    background-color: rgba(239, 68, 68, 0.02);
}

.date-input input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: var(--text-primary);
    font-size: 1rem;
    text-align: center;
    padding: 0;
    font-family: var(--font-sans);
}

.date-input input:focus {
    box-shadow: none !important;
}

.date-input .dd-field   { width: 30px; }
.date-input .mm-field   { width: 32px; }
.date-input .yyyy-field { width: 52px; }
.date-input .sep  { color: var(--text-muted); font-size: 1rem; font-weight: bold; }
