/* Modern CSS for Educational Program Forms */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px 0;
}

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

header {
    background: #f8f9fa;
    color: #2c3e50;
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid #e1e8ed;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: 600;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.form-container {
    padding: 30px;
}

.form-section {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
}

.form-section h2 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 20px;
    font-weight: 600;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.form-group input:invalid {
    border-color: #e74c3c;
}

.form-group input:valid {
    border-color: #27ae60;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: normal !important;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    min-height: 44px;
}

.checkbox-label:hover {
    background-color: #f1f3f4;
}

/* Date Selector Styles */
.date-selectors {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.date-select {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: #fff;
    cursor: pointer;
}

.date-select:focus {
    border-color: #6c63ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.2);
}

/* Hide the original date input */
input[type="date"] {
    display: none;
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 10px;
    transition: border-color 0.3s ease;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 10px;
    resize: vertical;
    min-height: 100px;
}

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

.form-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e1e8ed;
}

.submit-btn {
    background: #FFBE00;
    color: #2c3e50;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: #ffc926;
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

.modal-content.error {
    border-left: 4px solid #e74c3c;
}

.modal-content h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.modal-content p {
    margin-bottom: 20px;
    line-height: 1.6;
}

.modal-btn {
    background: #4facfe;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.modal-btn:hover {
    background: #3498db;
}

/* Success Modal Specific Styles */
.success-modal {
    max-width: 600px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Ensure all content has order 0 by default */
.success-modal > * {
    order: 2;
}

/* Make h3 first */
.success-modal h3 {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0 0 15px 0;
    order: 1;
    width: 100%;
    text-align: center;
}

/* Make image second */
.modal-image {
    width: 100%;
    max-width: 350px;
    height: auto;
    border-radius: 10px;
    margin: 0 0 15px 0;
    order: 2;
}

/* Make paragraphs come after */
.success-modal p {
    order: 3;
    margin: 0 0 15px 0;
    text-align: center;
    width: 100%;
}

.success-modal p {
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.success-btn {
    background: #FFBE00 !important;
    color: #00005A !important;
    font-weight: bold;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 2px solid #FFBE00;
    order: 4;
    margin-top: 20px;
}

.success-btn:hover {
    background: #e6a800 !important;
    border-color: #e6a800;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 190, 0, 0.3);
}

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

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error States */
.error-field {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 5px;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .modal-content {
        margin: 20% auto;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px 0;
    }
    
    .container {
        margin: 5px;
    }
    
    .form-container {
        padding: 15px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-group input,
    .form-group select,
    .form-group textarea {
        border-width: 3px;
    }
    
    .submit-btn {
        border: 2px solid #000;
    }
}
