/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}


.caf-admission-form,
.caf-fees-form {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    color: #333;
    line-height: 1.6;
}

/* Form Header */
.caf-form-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.caf-form-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Form Sections */
.caf-form-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.caf-form-section {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}

.caf-form-section:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.caf-form-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
}

.caf-form-section h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Form Groups */
.caf-form-group {
    margin-bottom: 25px;
}

.caf-form-group label {
    display: block;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.caf-form-group .required {
    color: #e53e3e;
    font-weight: 600;
}

/* Input Fields */
.caf-form-group input[type="text"],
.caf-form-group input[type="email"],
.caf-form-group input[type="tel"],
.caf-form-group input[type="number"],
.caf-form-group input[type="date"],
.caf-form-group select,
.caf-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #ffffff;
}

.caf-form-group input:focus,
.caf-form-group select:focus,
.caf-form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.caf-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Radio and Checkbox Groups */
.caf-radio-group,
.caf-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 8px;
}

.caf-radio-group label,
.caf-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 400;
    margin: 0;
}

.caf-radio-group label:hover,
.caf-checkbox-group label:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.caf-radio-group input[type="radio"],
.caf-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}





/* Total Amount Display */
.caf-total-amount {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-align: center;
}

.caf-total-amount strong {
    font-size: 18px;
    color: #495057;
}

#total-amount {
    color: #007bff;
    font-weight: bold;
}

/* Initial message styling */
#total-amount:contains('Select a plan') {
    color: #6c757d;
    font-style: italic;
    font-weight: normal;
}

/* Loading state */
.caf-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fees Loading State */
.fees-loading {
    opacity: 0.6;
    pointer-events: none;
}

.fees-loading-indicator {
    background: #e7f3ff;
    border: 1px solid #007cba;
    color: #007cba;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 600;
    grid-column: 1 / -1; /* Span all columns */
}

.fees-loading .plan-radio {
    cursor: not-allowed;
}

.fees-loading .caf-plan-option {
    cursor: not-allowed;
}

/* Total amount animation */
.caf-total-amount {
    transition: all 0.3s ease;
}

.caf-total-amount.updating {
    background: linear-gradient(135deg, #4c51bf 0%, #667eea 100%);
    transform: scale(1.02);
}

/* Submit Section */
.caf-submit-section {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.caf-submit-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.caf-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.caf-submit-button:active {
    transform: translateY(0);
}

/* Help Text */
.caf-help-text {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 6px;
    font-style: italic;
}

/* Modal Styles */
.caf-modal {
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.caf-modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.caf-modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.caf-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.caf-modal-close {
    font-size: 28px;
    cursor: pointer;
    color: white;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.caf-modal-close:hover {
    opacity: 1;
}

.caf-modal-body {
    padding: 30px;
    line-height: 1.7;
}

.caf-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e2e8f0;
    text-align: right;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .caf-admission-form {
        padding: 15px;
    }
    
    .caf-form-header h1 {
        font-size: 2rem;
    }
    
    .caf-form-section {
        padding: 20px;
    }
    

    
    .caf-radio-group,
    .caf-checkbox-group {
        flex-direction: column;
    }
    
    .caf-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .caf-terms-checkbox-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .caf-terms-checkbox-label input[type="checkbox"] {
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .caf-form-header h1 {
        font-size: 1.5rem;
    }
    
    .caf-form-section h2 {
        font-size: 1.3rem;
    }
    
    .caf-submit-button {
        padding: 14px 30px;
        font-size: 1rem;
    }
}

/* Success/Error Messages */
.caf-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
}

.caf-message.success {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.caf-message.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

/* File Upload Styling */
.caf-form-group input[type="file"] {
    padding: 10px;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    background: #f7fafc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.caf-form-group input[type="file"]:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

#image-preview {
    margin-top: 10px;
}

#image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

/* Section-specific styling */
.caf-section-child_particulars {
    border-left: 4px solid #4299e1;
}

.caf-section-parent_particulars {
    border-left: 4px solid #48bb78;
}



.caf-section-documents {
    border-left: 4px solid #9f7aea;
}

.caf-section-terms {
    border-left: 4px solid #f56565;
}

.caf-section-signatures {
    border-left: 4px solid #38b2ac;
}

/* Integrated Contact Information */
.caf-contact-info-integrated {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
    text-align: center;
}

.caf-contact-item {
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #4a5568;
    line-height: 1.4;
}

.caf-contact-item:last-child {
    margin-bottom: 0;
}

.caf-contact-label {
    font-weight: 600;
    color: #2d3748;
    margin-right: 8px;
}

.caf-contact-address {
    color: #718096;
    font-style: italic;
}

/* Terms and Conditions Styling */
.caf-terms-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.caf-terms-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.5;
    color: #4a5568;
}

.caf-terms-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
    margin-top: 2px;
    flex-shrink: 0;
}

.caf-terms-text {
    flex: 1;
}

.caf-terms-link {
    background: none;
    border: none;
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
    padding: 0;
    margin: 0;
    font-size: inherit;
    font-family: inherit;
    transition: color 0.3s ease;
}

.caf-terms-link:hover {
    color: #4c51bf;
    text-decoration: none;
}

.caf-terms-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Plans Styling */
.caf-plans-container {
    margin: 20px 0;
}

.caf-plans-label {
    display: block;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 16px;
}

.caf-plans-selection {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.caf-plan-category {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #f9f9f9;
}

.caf-category-title {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    border-bottom: 2px solid #007cba;
    padding-bottom: 8px;
}

/* Plan Selection Styles */
.caf-plan-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

@media (min-width: 768px) {
    .caf-plan-options {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1200px) {
    .caf-plan-options {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 25px;
    }
}

.caf-plan-option {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: #fff;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.caf-plan-option:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    transform: translateY(-2px);
}

.caf-plan-option.selected {
    border-color: #28a745;
    background: #f8fff9;
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.2);
    transform: translateY(-2px);
}

.caf-plan-option.selected::before {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.caf-plan-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.caf-plan-option input[type="radio"]:checked + .caf-plan-name {
    color: #28a745;
    font-weight: 600;
}

.caf-plan-option input[type="radio"]:checked ~ .caf-plan-price {
    color: #28a745;
    font-weight: 600;
}

.caf-plan-label {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    cursor: pointer;
}

.caf-plan-info {
    flex: 1;
}

.caf-plan-name {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    transition: color 0.3s ease;
    line-height: 1.3;
}

.caf-plan-price {
    font-size: 24px;
    font-weight: 700;
    color: #6c757d;
    margin-bottom: 8px;
    transition: color 0.3s ease;
    text-align: right;
}

.caf-plan-duration {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.caf-plan-category {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.caf-plan-option.selected .caf-plan-category {
    background: #28a745;
    color: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .caf-admission-form {
        max-width: 100%;
        padding: 15px;
    }
    
    .caf-plan-options {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .caf-plan-option {
        min-height: 100px;
        padding: 15px;
    }
    
    .caf-plan-name {
        font-size: 16px;
    }
    
    .caf-plan-price {
        font-size: 20px;
        text-align: left;
    }
    
    .caf-plan-duration {
        font-size: 13px;
    }
}

/* Form Progress Indicator */
.caf-progress-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.caf-progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.caf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.caf-progress-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.caf-progress-text span:first-child {
    font-weight: 600;
    font-size: 16px;
    color: #495057;
}

.caf-progress-text span:last-child {
    font-size: 14px;
    color: #6c757d;
}

/* Progress states */
.caf-progress-container.complete .caf-progress-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.caf-progress-container.warning .caf-progress-fill {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.caf-progress-container.error .caf-progress-fill {
    background: linear-gradient(90deg, #dc3545, #e83e8c);
}

/* Missing field highlighting */
.missing-field {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Required field indicators */
.required {
    color: #dc3545;
    font-weight: bold;
}

input[required], textarea[required], select[required] {
    border-left: 3px solid #dee2e6;
}

input[required]:valid, textarea[required]:valid, select[required]:valid {
    border-left-color: #28a745;
}

input[required]:invalid, textarea[required]:invalid, select[required]:invalid {
    border-left-color: #dc3545;
}

/* Error page button styles */
.caf-popup-footer .button-secondary {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

.caf-popup-footer .button-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
}

.caf-popup-footer .button-primary {
    background: #007cba;
    border-color: #007cba;
    color: white;
}

.caf-popup-footer .button-primary:hover {
    background: #005a87;
    border-color: #005a87;
}
