/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 50%;
    padding: 8px;
    object-fit: contain;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

.nav ul {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 30px;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #ffd700;
}

.apply-btn {
    background: #ffd700;
    color: #1e3c72;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.apply-btn:hover {
    background: #ffed4e;
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

.form-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.form-title {
    text-align: center;
    font-size: 28px;
    color: #1e3c72;
    margin-bottom: 30px;
    font-weight: bold;
    border-bottom: 3px solid #2a5298;
    padding-bottom: 15px;
}

/* Form Sections */
.form-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 20px;
    color: #1e3c72;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* Form Groups */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fff;
}

.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fff;
    appearance: none;
    -webkit-appearance: none;
    -moz-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 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

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

.field-note {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    font-weight: normal;
}

/* Terms Section */
.terms-text {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2a5298;
}

.terms-text p {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
}

/* Form Actions */
.form-actions {
    text-align: center;
    margin-top: 30px;
}

.submit-btn {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(30, 60, 114, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 60, 114, 0.4);
}

/* Messages */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: #3498db;
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-section p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #3498db;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-link {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: #3498db;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: #1e3c72;
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    border-top-color: #2a5298;
    animation-delay: -0.5s;
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
}

.spinner-ring:nth-child(3) {
    border-top-color: #ffd700;
    animation-delay: -1s;
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
}

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

.loading-text h3 {
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: 24px;
}

.loading-text p {
    color: #666;
    margin-bottom: 20px;
    font-size: 16px;
}

.loading-progress {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1e3c72, #2a5298, #ffd700);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 3px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 15px;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: white;
}

.notification-success .notification-icon {
    background: #28a745;
}

.notification-error .notification-icon {
    background: #dc3545;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    color: #666;
}

/* Name Fields Layout */
.name-fields {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.name-field-group {
    flex: 1;
    position: relative;
}

.name-field-group input {
    width: 100%;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.field-label {
    display: none;
}

/* Address Fields Layout */
.address-fields {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.address-field-group {
    flex: 1;
    position: relative;
}

.address-field-group input,
.address-field-group select {
    width: 100%;
    margin-bottom: 8px;
    box-sizing: border-box;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fff;
}

.address-field-group select:focus,
.address-field-group input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

/* Error Messages */
.error-message {
    display: none;
    align-items: center;
    gap: 5px;
    color: #dc3545;
    font-size: 12px;
    margin-top: 2px;
    margin-bottom: 10px;
}

.error-message.show {
    display: flex;
}

.error-icon {
    color: #dc3545;
    font-size: 14px;
    font-weight: bold;
}

.error-text {
    color: #dc3545;
}

/* Form Validation Styles */
.field-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.field-error + .error-message,
.field-error ~ .error-message {
    display: flex;
}

/* Remove default error styling on page load */
.address-field-group input:not(.field-error),
.name-field-group input:not(.field-error) {
    border-color: #e9ecef;
    box-shadow: none;
}

.checkbox-group.field-error {
    background: rgba(220, 53, 69, 0.05);
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #dc3545;
}

/* Radio Button Groups */
.checkbox-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-item input[type="radio"] {
    width: auto;
    margin: 0;
}

.checkbox-item label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

/* Info Section Styling */
.info-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #2a5298;
}

.info-section h4 {
    color: #1e3c72;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: bold;
}

.info-section p {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 10px;
}

/* Button Loading State */
.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 20px;
    }
    
    .nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .form-container {
        padding: 20px;
        margin: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .form-title {
        font-size: 24px;
    }
    
    .submit-btn {
        width: 100%;
        padding: 15px;
    }
    
    .loading-container {
        padding: 30px 20px;
    }
    
    .loading-text h3 {
        font-size: 20px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}
