/* Defence Eligibility Checker Styles - Updated Form Layout */

.defence-wrapper * {
    box-sizing: border-box;
}

.defence-wrapper {
    max-width: 850px;
    margin: 20px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eaeaea;
}

.form-header h2 {
    color: #1a365d;
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
}

.form-header p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

/* Form Layout */
.defence-form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.form-field {
    flex: 1;
    min-width: 0;
}

.form-field.half {
    flex: 0 0 calc(50% - 10px);
}

.defence-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.defence-wrapper label::after {
    content: " *";
    color: #e53e3e;
    margin-left: 2px;
}

#defenceForm input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: #fafafa;
    color: #2d3748;
}

#defenceForm input::placeholder {
    color: #a0aec0;
    font-size: 14px;
}

#defenceForm input:hover {
    border-color: #a0aec0;
    background: #f7fafc;
}

#defenceForm input:focus {
    outline: none;
    border-color: #4299e1;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

#defenceForm input[type="date"] {
    color: #2d3748;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#defenceForm input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    background-color: #f7fafc;
}

/* Submit Button */
.defence-submit-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
}

#checkEligibility {
    width: 100%;
    padding: 14px 20px;
    background: #2b6cb0;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#checkEligibility:hover {
    background: #2c5282;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(43, 108, 176, 0.2);
}

#checkEligibility:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(43, 108, 176, 0.2);
}

#checkEligibility:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-text {
    font-weight: 600;
}

.loading-spinner {
    display: none;
    font-size: 14px;
    font-weight: 500;
}

#checkEligibility:disabled .loading-spinner {
    display: inline;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.5; 
    }
}

.disclaimer {
    font-size: 12px;
    color: #718096;
    text-align: center;
    margin-top: 12px;
    line-height: 1.5;
    padding: 0 10px;
}

/* Results Section - Improved Layout */
.defence-result-container {
    margin-top: 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    background: linear-gradient(135deg, #2b6cb0 0%, #4299e1 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.result-header h3 {
    margin: 0 0 10px 0;
    font-size: 22px;
    font-weight: 600;
}

.current-age {
    font-size: 18px;
    font-weight: 600;
    color: #ebf8ff;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 5px;
}

.result-section {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.result-section:last-child {
    border-bottom: none;
}

.result-section h4 {
    margin: 0 0 15px 0;
    color: #2b6cb0;
    font-size: 18px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.exam-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 6px;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.exam-result:hover {
    transform: translateX(4px);
    background: #edf2f7;
}

.exam-name {
    flex: 1;
    font-weight: 600;
    color: #1a202c;
    font-size: 15px;
}

.eligible, .not-eligible {
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 100px;
    text-align: center;
}

.eligible {
    color: #22543d;
    background: #c6f6d5;
    border: 1px solid #9ae6b4;
}

.not-eligible {
    color: #742a2a;
    background: #fed7d7;
    border: 1px solid #fc8181;
}

/* Responsive Design */
@media (max-width: 768px) {
    .defence-wrapper {
        padding: 20px;
        margin: 10px;
        max-width: 95%;
    }
    
    .form-field.half {
        flex: 0 0 100%;
    }
    
    .form-row {
        gap: 15px;
    }
    
    .result-section {
        padding: 15px;
    }
    
    .result-header {
        padding: 15px;
    }
    
    .result-header h3 {
        font-size: 20px;
    }
    
    .current-age {
        font-size: 16px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .defence-wrapper {
        padding: 15px;
    }
    
    .form-header h2 {
        font-size: 20px;
    }
    
    .exam-result {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 15px;
    }
    
    .exam-name {
        width: 100%;
    }
    
    .eligible, .not-eligible {
        align-self: flex-start;
        min-width: auto;
        padding: 6px 12px;
    }
    
    #checkEligibility {
        padding: 12px 15px;
        font-size: 15px;
    }
}

/* Form Validation Styles */
input:required:invalid {
    border-color: #ed8936;
    background-color: #fffaf0;
}

input:required:valid {
    border-color: #48bb78;
    background-color: #f0fff4;
}

.validation-message {
    color: #c53030;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

input:invalid + .validation-message {
    display: block;
}

/* Input Icons */
.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-left: 40px;
}

.input-with-icon .icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
}

/* Focus Styles for Accessibility */
#defenceForm input:focus-visible {
    outline: 2px solid #2b6cb0;
    outline-offset: 2px;
}

#checkEligibility:focus-visible {
    outline: 2px solid #2b6cb0;
    outline-offset: 2px;
}

/* Date Input Custom Styling */
.date-input-container {
    position: relative;
}

.date-input-container::after {
    content: "📅";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #718096;
}

/* Mobile Optimizations */
@media (max-width: 360px) {
    .defence-wrapper {
        padding: 12px;
    }
    
    #defenceForm input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .result-section h4 {
        font-size: 16px;
    }
    
    .exam-name {
        font-size: 14px;
    }
}

/* Animation for form submission */
@keyframes formSubmit {
    0% { transform: scale(1); }
    50% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

.defence-form-group.submitting {
    animation: formSubmit 0.3s ease;
}

/* Error State */
.form-error {
    background: #fed7d7;
    border: 1px solid #fc8181;
    color: #742a2a;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

/* Success Message */
.form-success {
    background: #c6f6d5;
    border: 1px solid #9ae6b4;
    color: #22543d;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}