/* ==================================================================
   Global Form Styles (forms.css)
   ================================================================== */

/* --- Step Indicator --- */
.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
    gap: 0.5rem;
    flex-wrap: wrap; /* يسمح بالتفاف الخطوات في الجوال */
}

@media (max-width: 576px) {
    .step {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    .step-number {
        width: 22px;
        height: 22px;
        font-size: 0.8rem;
        margin-right: 0.5rem;
    }
}

.step {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.5rem;
    background-color: #f1f5f9; /* cool-gray-100 */
    border-radius: 50px;
    font-weight: 600;
    color: #475569; /* cool-gray-600 */
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0; /* cool-gray-200 */
}

.step-number {
    background-color: #94a3b8; /* cool-gray-400 */
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem; /* RTL support */
    transition: all 0.3s ease;
}

.step.active {
    background: linear-gradient(135deg, var(--primary-accent, #3b82f6) 0%, var(--primary-dark, #1d4ed8) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.step.active .step-number {
    background-color: white;
    color: var(--primary-accent, #3b82f6);
}

/* --- Service Selection Cards --- */
.service-selection-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 2.5rem 1.25rem;
    flex-wrap: wrap;
}

.service-card {
    width: 280px;
    height: 220px;
    background: var(--card-bg, #ffffff);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    padding: 1.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: var(--text-color, #1e293b);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color, #e2e8f0);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-accent, #3b82f6);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-accent, #3b82f6);
}

.service-card i {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
}

.service-card:hover i {
    transform: scale(1.1) rotate(5deg);
}

.service-card h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color, #1e293b);
}

/* --- General Form Container --- */
.form-container {
    background: var(--card-bg, #ffffff);
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
    padding: 2rem 2.5rem;
    border: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    .form-container {
        padding: 1.25rem 1rem;
        border-radius: 0.75rem;
    }
    
    .form-container h1 {
        font-size: 1.35rem;
        margin-bottom: 1.5rem;
    }
    
    /* تصغير الأزرار والمسافات في الجوال */
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    .form-section {
        padding: 1.25rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .form-section h5 {
        font-size: 1.1rem;
        font-weight: bold;
    }
}

.form-container h1 {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-accent) 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    font-size: 1.75rem;
    font-weight: 700;
}

/* --- Form Grid & Groups --- */
/* --- Form Grid & Groups --- */
.form-grid, .marriage-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem 1.75rem; /* تحسين الفجوات */
}

@media (max-width: 992px) {
    .form-grid, .marriage-form {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* --- Photo Preview Circle --- */
.photo-preview-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 3px solid var(--primary-light, #a8dadc);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .photo-preview-circle {
        width: 60px;
        height: 60px;
    }
}

/* --- Responsive Table Fix (Stacking) --- */
@media (max-width: 768px) {
    .table-responsive-stack { border: 0; }
    .table-responsive-stack thead { display: none; }
    .table-responsive-stack, 
    .table-responsive-stack tbody, 
    .table-responsive-stack tr, 
    .table-responsive-stack td { 
        display: block; 
        width: 100%; 
    }
    
    .table-responsive-stack tr {
        margin-bottom: 1.5rem;
        border: 1px solid var(--border-color, #e2e8f0);
        border-radius: 1rem;
        background: #fff;
        padding: 1rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    }
    
    .table-responsive-stack td {
        text-align: right;
        padding: 0.75rem 0.5rem !important;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dashed #f1f5f9;
        font-size: 0.9rem;
    }
    
    .table-responsive-stack td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--primary-dark, #1e293b);
        margin-left: 1rem;
        flex-shrink: 0;
        font-size: 0.85rem;
        opacity: 0.8;
    }
    
    .table-responsive-stack td:last-child { 
        border-bottom: none; 
        justify-content: center; 
        margin-top: 10px;
        background: #f8fafc;
        border-radius: 0.5rem;
    }
}

.form-group-span-2 {
    grid-column: span 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem 1.5rem;
}

/* --- الخطوة الثانية: عرض الحقول في الجوال واحد فوق الآخر بناءً على طلب المستخدم الأخير --- */
.step2-mobile-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem 1.5rem;
}

@media (max-width: 600px) {
    .form-grid, .marriage-form, .step2-mobile-row {
        grid-template-columns: 1fr;
    }
    .form-group-span-2 {
        grid-column: span 1;
        grid-template-columns: 1fr;
    }
}

.button-group {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dee2e6;
    flex-wrap: wrap; /* التفاف الأزرار في الجوال */
}

@media (max-width: 576px) {
    .button-group .btn {
        width: 100%; /* الأزرار تأخذ العرض كامل في الجوال الصغير */
        margin-bottom: 0.5rem;
    }
}

/* --- Step 2 Details Section --- */
.details-section {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: .75rem;
    margin-bottom: 2rem;
    overflow: hidden;
}

@media (max-width: 768px) {
    .details-section {
        margin-left: -10px;
        margin-right: -10px;
        border-radius: 0;
        border-right: none;
        border-left: none;
    }
}

.details-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark, #003366);
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-light, #dee2e6);
    margin-bottom: 1.25rem;
    display: block;
}

/* --- Collapsible Form --- */
.btn-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.2rem;
}

.form-collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
    background-color: #fdfdff;
    border-radius: 0.5rem;
    margin-top: 1rem;
    padding: 0 1.5rem;
}

.form-collapsible.show {
    padding: 1.5rem;
}