@font-face {
    font-family: 'KurdishFont';
    src: url('kurdish-font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

[dir="rtl"], [dir="rtl"] * {
    font-family: 'KurdishFont', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    min-height: 100vh;
    padding: 20px;
}

.flag-stripe { 
    height: 6px; 
    background: linear-gradient(to right, 
        #CE1126 0%, #CE1126 33.33%,
        #FFFFFF 33.33%, #FFFFFF 46.5%,
        #EAC102 46.5%, #EAC102 53.5%,
        #FFFFFF 53.5%, #FFFFFF 66.66%,
        #007A3D 66.66%, #007A3D 100%
    );
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.container {
    max-width: 900px;
    margin: 40px auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
    padding: 40px;
    text-align: center;
    color: white;
}

.header h1 {
    font-size: 36px;
    margin-bottom: 10px;
    direction: rtl;
}

.header p {
    font-size: 18px;
    opacity: 0.9;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    transition: all 0.3s;
}

.back-link:hover {
    background: rgba(255,255,255,0.3);
    transform: translateX(-5px);
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px 0 15px 0;
    gap: 0;
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    z-index: 2;
}

.progress-step.active {
    background: #f59e0b;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

.progress-step.completed {
    background: #22c55e;
}

.progress-line {
    width: 60px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    z-index: 1;
}

.progress-line.completed {
    background: #22c55e;
}

.step-title {
    font-size: 16px;
    opacity: 0.9;
    margin-top: 15px;
}

form {
    padding: 40px;
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
}

.form-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 24px;
    color: #0c4a6e;
    margin-bottom: 25px;
    direction: rtl;
    text-align: right;
}

.subsection-header {
    background: #f0f9ff;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 25px 0 20px 0;
    border-left: 4px solid #0891b2;
}

.subsection-header h3 {
    font-size: 18px;
    color: #0c4a6e;
    direction: rtl;
    text-align: right;
    margin: 0;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    direction: rtl;
    text-align: right;
}

label .required {
    color: #dc2626;
    margin-left: 4px;
}

label .english {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    direction: ltr;
    display: inline-block;
}

.helper-text {
    font-size: 13px;
    color: #64748b;
    margin-top: 6px;
    direction: rtl;
    text-align: right;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="month"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    font-family: inherit;
    direction: ltr;
    text-align: left;
}

/* CRITICAL FIX: Date input width on mobile */
input[type="date"],
input[type="month"],
.date-input {
    max-width: 100%;
    overflow: hidden;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #0891b2;
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    direction: rtl;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-option:hover,
.checkbox-option:hover {
    border-color: #0891b2;
    background: #f0f9ff;
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.file-upload {
    border: 2px dashed #0891b2;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    background: #f0f9ff;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload:hover {
    background: #e0f2fe;
    border-color: #0e7490;
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-icon {
    font-size: 48px;
    color: #0891b2;
    margin-bottom: 12px;
}

.file-upload-text {
    font-size: 16px;
    color: #0c4a6e;
    font-weight: 600;
    margin-bottom: 8px;
}

.file-upload-hint {
    font-size: 13px;
    color: #64748b;
    direction: rtl;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: space-between;
}

.next-btn,
.submit-btn {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    padding: 18px 50px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 20px rgba(8, 145, 178, 0.3);
    flex: 1;
}

.next-btn:hover,
.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(8, 145, 178, 0.4);
}

.back-btn {
    background: #e2e8f0;
    color: #1e293b;
    padding: 18px 50px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #cbd5e1;
    transform: translateY(-2px);
}

.success-msg {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid #86efac;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 12px;
    direction: rtl;
    text-align: right;
}

.success-msg.show {
    display: flex;
}

.success-msg::before {
    content: '✓';
    width: 28px;
    height: 28px;
    background: #22c55e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .container {
        margin: 20px auto;
    }
    
    .header {
        padding: 30px 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .header p {
        font-size: 14px;
    }
    
    .progress-bar {
        margin: 20px 0 10px 0;
    }
    
    .progress-step {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .progress-line {
        width: 40px;
    }
    
    form {
        padding: 25px 20px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* CRITICAL: Fix date inputs on mobile */
    input[type="date"],
    input[type="month"],
    .date-input {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .next-btn,
    .submit-btn,
    .back-btn {
        width: 100%;
        padding: 15px 30px;
        font-size: 16px;
    }
    
    .file-upload {
        padding: 30px 20px;
    }
}

/* Welcome Section Styles */
.welcome-section {
    padding: 80px 40px;
    text-align: center;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 20px;
    margin: 20px;
}

.welcome-icon {
    font-size: 80px;
    margin-bottom: 30px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.welcome-title {
    font-size: 48px;
    font-weight: 800;
    color: #0c4a6e;
    margin-bottom: 10px;
    direction: rtl;
}

.welcome-subtitle {
    font-size: 28px;
    color: #0891b2;
    font-weight: 600;
    margin-bottom: 40px;
}

.welcome-text {
    font-size: 20px;
    color: #1e293b;
    line-height: 1.8;
    margin-bottom: 15px;
    direction: rtl;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.welcome-text-english {
    font-size: 18px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.start-btn {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    padding: 25px 70px;
    border: none;
    border-radius: 15px;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(8, 145, 178, 0.3);
}

.start-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(8, 145, 178, 0.4);
}

@media (max-width: 768px) {
    .welcome-section {
        padding: 50px 20px;
        margin: 10px;
    }
    
    .welcome-icon {
        font-size: 60px;
    }
    
    .welcome-title {
        font-size: 32px;
    }
    
    .welcome-subtitle {
        font-size: 20px;
    }
    
    .welcome-text {
        font-size: 17px;
    }
    
    .welcome-text-english {
        font-size: 15px;
    }
    
    .start-btn {
        padding: 20px 50px;
        font-size: 20px;
    }
}

/* Upload Success Message */
.upload-success-msg {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 2px solid #86efac;
    font-weight: 600;
    text-align: center;
    direction: rtl;
    animation: slideDown 0.3s ease;
}

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

/* Clear Upload Button */
.clear-upload-btn {
    background: #ef4444;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
    width: 100%;
}

.clear-upload-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

@media (max-width: 768px) {
    .upload-success-msg {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .clear-upload-btn {
        font-size: 14px;
        padding: 10px 25px;
    }
}

/* Upload Preview Styles */
.upload-preview {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-image {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    object-fit: contain;
    background: white;
    padding: 5px;
}

.preview-pdf {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .preview-image {
        max-width: 150px;
        max-height: 120px;
    }
    
    .preview-pdf {
        width: 100px;
        height: 100px;
        font-size: 36px;
    }
}