/* Form Styles - Updated with Enhanced Design */
.form-container {
    background-color: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    max-width: 1000px;
    margin: 2rem auto;
    border: 1px solid #f0f0f0;
}

.form-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-blue);
    font-size: 2.2rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 1rem;
}

.form-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-green));
    border-radius: 2px;
}

.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: var(--radius);
    padding: 2rem;
    transition: all 0.3s ease;
}

.form-section:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-section:last-of-type {
    border-bottom: none;
}

.section-heading {
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 4px solid var(--secondary-green);
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-heading::before {
    content: '📋';
    font-size: 1.2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.required::after {
    content: " *";
    color: #e74c3c;
    font-weight: bold;
}

input, select, textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1.5px solid #e1e8ed;
    border-radius: var(--radius);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fff;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 87, 146, 0.1);
    background-color: #fafbfc;
}

input:valid, select:valid, textarea:valid {
    border-color: #27ae60;
}

input:invalid, select:invalid {
    border-color: #e74c3c;
}

/* Enhanced select styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

/* Enhanced textarea styling */
textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* Form field icons */
.form-group::before {
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif;
    position: absolute;
    right: 1rem;
    top: 2.6rem;
    font-size: 1.1rem;
    pointer-events: none;
}

#full_name::before { content: '👤'; }
#email::before { content: '📧'; }
#whatsapp_number::before { content: '📱'; }
#passport_number::before { content: '🛂'; }

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #f0f0f0;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 140px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), #0077b6);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 87, 146, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 87, 146, 0.4);
    background: linear-gradient(135deg, #004275, #005792);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}

/* Loading state for buttons */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-right-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: modalAppear 0.3s ease-out;
    position: relative;
    border: 1px solid #e1e8ed;
}

.modal-content::before {
    content: '✅';
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal h2 {
    color: var(--secondary-green);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.modal p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: #555;
}

/* Error states */
.error-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
    font-weight: 500;
    padding-left: 0.5rem;
    border-left: 2px solid #e74c3c;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

.form-group.error .error-message {
    display: block;
}

/* Success states */
.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: #27ae60;
    background-color: #f0f9f0;
}

/* Field hints and descriptions */
.field-hint {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Character counter for textareas */
.char-counter {
    font-size: 0.8rem;
    color: #666;
    text-align: right;
    margin-top: 0.25rem;
}

.char-counter.warning {
    color: #f39c12;
}

.char-counter.error {
    color: #e74c3c;
}

/* Responsive Styles for Application Page */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .form-section {
        padding: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn {
        width: 100%;
        min-width: auto;
    }
    
    .form-title {
        font-size: 1.8rem;
    }
    
    .section-heading {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    input, select, textarea {
        padding: 0.8rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
}

/* Print Styles */
@media print {
    .form-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .btn, .whatsapp-float {
        display: none !important;
    }
    
    .form-section {
        break-inside: avoid;
    }
}