/* =========================================
   MULTI-STEP ELIGIBILITY MODAL CSS
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    width: 95%;
    max-width: 800px;
    height: auto;
    max-height: 90vh;
    /* Prevents overflow on short screens */
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow-y: auto;
    /* Contains children */
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* =========================================
   MODAL HEADER ROW — flex layout fix
   ========================================= */

/* Top bar: a slim flex strip that contains ONLY the close button */
.modal-top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 4px;
    /* tight gap before step content */
}

/* Close button — in-flow inside .modal-top-bar */
.close-btn {
    flex-shrink: 0;
    position: static;
    /* NO absolute; participates in normal flow */
    font-size: 26px;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 2px 4px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.close-btn:hover {
    color: #374151;
    background: #f3f4f6;
}

/* Step header row: title (left) + any inline action (right) */
.modal-step-header {
    margin-bottom: 20px;
}

.modal-step-header h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 10px;
    word-break: break-word;
    /* long titles wrap cleanly */
    overflow-wrap: break-word;
    padding-right: 0;
    /* no extra padding needed — top-bar handles spacing */
}

/* Responsive: tighten top-bar on small screens */
@media (max-width: 480px) {
    .modal-top-bar {
        margin-bottom: 2px;
    }

    .close-btn {
        font-size: 22px;
    }

    .modal-step-header h2 {
        font-size: 1.2rem;
    }
}


.step-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(140px, 20vw, 180px), 1fr));
    gap: 15px;
    padding: 10px 0;
}

.step-option-btn {
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    transition: all 0.2s;
    color: #4b5563;
}

.step-option-btn:hover {
    background: #e0f2fe;
    /* Light Blue 100 */
    border-color: #0ea5e9;
    /* Sky 500 */
    color: #0c4a6e;
}

.step-option-btn.selected {
    background: #0ea5e9;
    color: white;
    border-color: #0ea5e9;
}

.modal-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.search-input-wrapper {
    margin-top: 15px;
}

.search-input-wrapper input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

/* Course Accordion Styles */
.course-accordion {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.course-accordion.open {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.accordion-header {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #ffffff;
    border-radius: 12px;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: #f8fafc;
}

.accordion-header input {
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    font-size: 1rem;
    color: #475569;
    cursor: pointer;
    font-weight: 500;
}

.accordion-header input::placeholder {
    color: #94a3b8;
}

.accordion-icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
    color: #94a3b8;
    margin-left: 10px;
    font-weight: bold;
}

.course-accordion.open .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 20px;
    background: #ffffff;
}

.course-accordion.open .accordion-content {
    max-height: 600px;
    /* Allow enough space for tags */
    padding-top: 10px;
    padding-bottom: 20px;
    border-top: 1px solid #f1f5f9;
}

.popular-courses-title {
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #64748b;
}

.extra-courses-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.course-tag {
    padding: 10px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-tag:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1);
}

.name-input-field {
    width: 100%;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.modal-btn-primary {
    background: #009688;
    /* Teal color matching images */
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    /* Default to full width for consistency in forms */
}

.modal-btn-primary:hover {
    background: #00796b;
}

.modal-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* =========================================
   NEW SPLIT LAYOUT FOR CONTACT & OTP STEPS
   ========================================= */
.step-split-layout {
    display: flex;
    gap: 40px;
}

.split-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.split-right {
    flex: 1;
}

.split-left h2 {
    font-size: 1.8rem;
    color: #1f2937;
    line-height: 1.3;
    font-weight: 700;
}

/* Contact Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #9ca3af;
    border-radius: 6px;
    font-size: 1rem;
}

.phone-input-group {
    display: flex;
    gap: 10px;
}

.phone-code {
    width: 80px;
    padding: 12px;
    border: 1px solid #9ca3af;
    border-radius: 6px;
    background: #f9fafb;
    text-align: center;
}

.disclaimer-text {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 10px;
    margin-bottom: 20px;
}

.ps-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 20px;
}

/* OTP Styles */
.otp-info-text {
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #374151;
}

.correct-details-link {
    color: #009688;
    text-decoration: underline;
    cursor: pointer;
    margin-left: 5px;
}

.otp-inputs-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.otp-box {
    width: 45px;
    height: 50px;
    border: 1px solid #d1d5db;
    /* Default border */
    border-radius: 8px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.otp-box:focus {
    border-color: #009688;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 150, 136, 0.2);
}

.otp-box.error {
    border-color: #dc2626;
}

.error-text {
    color: #dc2626;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
    visibility: hidden;
    /* Hidden by default */
}

.resend-text {
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 20px;
    color: #4b5563;
}

.resend-link {
    color: #1f2937;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: clamp(15px, 4vw, 25px);
        border-radius: 16px;
        margin: 0;
        max-height: 95vh;
    }

    .step-split-layout {
        flex-direction: column;
        gap: 1.5rem;
    }

    .split-left {
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .split-left h2 {
        font-size: clamp(1.3rem, 5vw, 1.6rem);
    }

    .modal-step-header h2 {
        font-size: 1.2rem;
        text-align: center;
    }

    .otp-inputs-container {
        justify-content: center !important;
        gap: clamp(4px, 2vw, 10px);
    }

    .otp-box {
        width: clamp(35px, 11vw, 45px) !important;
        height: clamp(45px, 14vw, 55px) !important;
    }

    .combined-footer {
        flex-direction: column-reverse;
        gap: 15px;
        margin-top: 25px !important;
    }

    .combined-footer button {
        width: 100% !important;
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 15px;
        border-radius: 12px;
    }

    .step-options {
        grid-template-columns: 1fr;
    }

    .step-option-btn {
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .disclaimer-text {
        text-align: center;
        font-size: 0.7rem;
    }

    .phone-input-group {
        flex-direction: column;
        gap: 8px;
    }

    .phone-code {
        width: 100% !important;
    }

    .modal-nav {
        margin-top: 10px;
    }
}