/* تحسينات النماذج - مؤسسة حليمة علي بن أحمد الغامدي */

/* Form Section */
.form-section {
    padding: 0.5rem 0;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-header {
    text-align: center;
    margin-bottom: 1rem;
}

.form-title {
    font-size: clamp(1.3rem, 4vw, 2rem);
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.2rem;
    line-height: 1.1;
}

.form-subtitle {
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    color: #6b7280;
    font-weight: 400;
    line-height: 1.2;
}

.complaint-form {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
}

.form-group {
    margin-bottom: 0.6rem;
}

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

.form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

/* حقل رقم الهاتف من اليمين إلى اليسار */
#phone {
    direction: rtl;
    text-align: right;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    background: white;
}

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

.form-file {
    width: 100%;
    padding: 1rem;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    background: rgba(249, 250, 251, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-file:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Checkbox Styles */
.checkbox-group {
    margin: 2rem 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #1e40af;
    border-color: #1e40af;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.terms-link {
    color: #1e40af;
    text-decoration: none;
    font-weight: 600;
}

.terms-link:hover {
    text-decoration: underline;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn-large {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    min-width: 150px;
}

/* Navigation Styles */
.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* Error States */
.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
}

/* Success States */
.form-input.success,
.form-select.success,
.form-textarea.success {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Loading State */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    color: white;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-section {
        padding: 0.3rem 0;
        min-height: calc(100vh - 70px);
    }
    
    .form-header {
        margin-bottom: 0.8rem;
    }
    
    .complaint-form {
        padding: 0.8rem;
        margin: 0.2rem;
        border-radius: 12px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    
    .form-title {
        font-size: 1.4rem;
        margin-bottom: 0.2rem;
    }
    
    .form-subtitle {
        font-size: 0.8rem;
        margin-bottom: 0.8rem;
        color: #6b7280;
    }
    
    .form-group {
        margin-bottom: 0.6rem;
    }
    
    .form-label {
        font-size: 0.85rem;
        font-weight: 600;
        margin-bottom: 0.3rem;
        color: #374151;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.6rem;
        font-size: 0.85rem;
        border-radius: 8px;
        border: 1px solid #e5e7eb;
        transition: all 0.2s ease;
    }
    
    .form-textarea {
        min-height: 60px;
        resize: vertical;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: center;
        margin-top: 1rem;
        gap: 0.5rem;
    }
    
    .btn-large {
        width: 100%;
        max-width: 200px;
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        border-radius: 8px;
        font-weight: 600;
    }
    
    .nav {
        display: none;
    }
    
    .header-content {
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .form-section {
        padding: 0.2rem 0;
        min-height: calc(100vh - 60px);
    }
    
    .form-header {
        margin-bottom: 0.6rem;
        padding: 0;
    }
    
    .complaint-form {
        padding: 0.6rem;
        margin: 0.1rem;
        border-radius: 10px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.04);
    }
    
    .form-title {
        font-size: 1.2rem;
        text-align: center;
        margin-bottom: 0.1rem;
        font-weight: 700;
    }
    
    .form-subtitle {
        font-size: 0.75rem;
        text-align: center;
        margin-bottom: 0.6rem;
        color: #6b7280;
        line-height: 1.2;
    }
    
    .form-group {
        margin-bottom: 0.5rem;
    }
    
    .form-label {
        font-size: 0.8rem;
        font-weight: 600;
        margin-bottom: 0.2rem;
        display: block;
        text-align: right;
        color: #374151;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.5rem;
        font-size: 0.8rem;
        border-radius: 6px;
        border: 1px solid #d1d5db;
        background: #ffffff;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
        transition: all 0.2s ease;
    }
    
    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        border-color: #1e40af;
        box-shadow: 0 0 0 1px rgba(30, 64, 175, 0.1);
    }
    
    .form-textarea {
        min-height: 50px;
        resize: vertical;
    }
    
    .form-actions {
        margin-top: 0.8rem;
        gap: 0.4rem;
    }
    
    .btn-large {
        width: 100%;
        max-width: 180px;
        padding: 0.6rem;
        font-size: 0.8rem;
        font-weight: 600;
        border-radius: 6px;
        box-shadow: 0 2px 8px rgba(30, 64, 175, 0.15);
        transition: all 0.2s ease;
    }
    
    .btn-large:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
    }
}

@media (max-width: 360px) {
    .complaint-form {
        padding: 1rem 0.6rem;
        margin: 0.2rem;
        border-radius: 12px;
    }
    
    .form-title {
        font-size: 1.5rem;
        margin-bottom: 0.2rem;
    }
    
    .form-subtitle {
        font-size: 0.8rem;
        margin-bottom: 1rem;
        line-height: 1.3;
    }
    
    .form-header {
        margin-bottom: 1.2rem;
    }
    
    .form-group {
        margin-bottom: 0.9rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.8rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .form-textarea {
        min-height: 80px;
    }
    
    .btn-large {
        padding: 0.9rem;
        font-size: 0.95rem;
        border-radius: 10px;
    }
}

/* File Upload Enhancement */
.file-upload-area {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: rgba(249, 250, 251, 0.8);
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.file-upload-area.dragover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.file-upload-text {
    color: #6b7280;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.file-upload-icon {
    font-size: 2rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    width: 0%;
    transition: width 0.3s ease;
}

/* تحسين عرض النص في الجوال للشروط والأحكام */
@media (max-width: 768px) {
    .checkbox-label {
        font-size: 0.9rem;
        line-height: 1.8;
        text-align: right;
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .checkbox-label .terms-link {
        display: inline;
        margin: 0 0.1rem;
        white-space: normal;
        word-break: break-word;
    }
    
    .checkbox-group {
        margin: 2rem 0;
        padding: 0 0.5rem;
    }
    
    .checkmark {
        margin-top: 3px;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .checkbox-label {
        font-size: 0.85rem;
        line-height: 2;
        text-align: right;
        word-spacing: 0.05rem;
        display: block;
        padding-right: 2rem;
        position: relative;
    }
    
    .checkmark {
        position: absolute;
        right: 0;
        top: 2px;
        margin-top: 0;
    }
    
    .checkbox-group {
        margin-bottom: 2.5rem;
        padding: 0 0.5rem;
    }
    
    .terms-link {
        font-weight: 500;
        padding: 0.05rem 0.1rem;
        display: inline;
        white-space: normal;
        word-break: break-word;
    }
}

@media (max-width: 360px) {
    .checkbox-label {
        font-size: 0.8rem;
        line-height: 2.2;
        padding-right: 1.8rem;
    }
    
    .checkmark {
        width: 18px;
        height: 18px;
    }
    
    .terms-link {
        font-size: 0.8rem;
    }
}
