/* Registration Form Styles */

.registration-section {
    padding: 60px 0;
    background: #f8f9fa;
    min-height: 100vh;
    margin-top: 100px; /* offset for fixed header */
}

.registration-header {
    text-align: center;
    margin-bottom: 50px;
}

.registration-header h1 {
    font-size: 48px;
    font-weight: 800;
    color: #ff6b35;
    margin-bottom: 20px;
}

.registration-header p {
    font-size: 18px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.registration-form {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h2 i {
    color: #ff6b35;
    font-size: 20px;
}

.section-note {
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
}

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

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

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

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

.form-group [aria-invalid="true"] {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

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

.field-error {
    margin-top: 6px;
    color: #d32f2f !important; /* ensure red is visible */
    font-size: 12px;
    line-height: 1.4;
}

.lookup-field {
    position: relative;
    display: flex;
}

.lookup-field input {
    padding-right: 50px;
    background: #f8f9fa;
    cursor: pointer;
}

.lookup-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.lookup-btn:hover {
    background: #e55a2b;
}

.phone-field {
    display: flex;
    gap: 10px;
}

.country-code {
    flex: 0 0 120px;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.phone-field input {
    flex: 1;
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.program-checkbox {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.program-checkbox:hover {
    border-color: #ff6b35;
    background: #fff5f2;
}

.program-checkbox input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.program-checkbox input[type="checkbox"]:checked + .checkmark {
    background: #ff6b35;
    border-color: #ff6b35;
}

.program-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.program-name {
    font-weight: 500;
    color: #333;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.radio-mark {
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:focus + .radio-mark {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

.radio-option input[type="radio"]:checked + .radio-mark {
    border-color: #ff6b35;
}

.radio-option input[type="radio"]:checked + .radio-mark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #ff6b35;
    border-radius: 50%;
}

.radio-text {
    font-weight: 500;
    color: #333;
}

.agreement-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.agreement-checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
}

.agreement-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.agreement-checkbox .checkmark {
    margin-right: 15px;
    margin-top: 2px;
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    background: #fff;
    position: relative;
    transition: all 0.2s ease;
}

.agreement-checkbox input[type="checkbox"]:focus + .checkmark {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

.agreement-checkbox input[type="checkbox"]:checked + .checkmark {
    background: #ff6b35;
    border-color: #ff6b35;
}

.agreement-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: 2px solid #fff;
    border-top: 0;
    border-left: 0;
    transform: rotate(45deg);
}

.agreement-text {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.form-actions {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.btn-submit {
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Lookup 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);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #ff6b35;
}

.modal-body {
    padding: 30px;
}

.search-field {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-field input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
}

.search-field button {
    padding: 12px 20px;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-field button:hover {
    background: #e55a2b;
}

.lookup-results {
    max-height: 400px;
    overflow-y: auto;
}

.lookup-item {
    padding: 15px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lookup-item:hover {
    background: #f8f9fa;
    border-color: #ff6b35;
}

.lookup-item:last-child {
    margin-bottom: 0;
}

.lookup-item h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 16px;
}

.lookup-item p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Autocomplete Suggestions */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-suggestion {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.selected {
    background-color: #f8f9fa;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.form-group {
    position: relative;
}

/* Responsive Design */
@media (max-width: 768px) {
    .registration-form {
        margin: 0 20px;
        padding: 30px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .programs-grid {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .phone-field {
        flex-direction: column;
        gap: 10px;
    }
    
    .country-code {
        flex: none;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .registration-header h1 {
        font-size: 36px;
    }
    
    .registration-header p {
        font-size: 16px;
    }
    
    .form-section h2 {
        font-size: 20px;
    }
    
    .btn-submit {
        padding: 12px 30px;
        font-size: 14px;
    }
}

/* Field Error Messages */
.field-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: none;
    font-weight: 500;
}

.field-error.show {
    display: block;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1);
}

.form-group.error label {
    color: #e74c3c;
}

.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: #27ae60;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.1);
}
