/* --- Global Text Selection Lock --- */
body {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10 and IE 11 */
    user-select: none; /* Standard syntax */
}

/* Allow text selection only inside input fields and textareas */
input, textarea {
    -webkit-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #fcf9f9;
    color: #0f384a; 
    min-height: 100vh;
    overflow-x: hidden; /* Fix horizontal scroll clipping */
    position: relative;
}

/* ================= MODERN TOAST NOTIFICATION ================= */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    transform: translateY(-20px);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success { background: #2ed573; color: #fff; }
.toast.error { background: #ff4757; color: #fff; }

/* ================= BACKGROUND SHAPES ================= */
.shapes-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.shape {
    position: absolute;
    transition: all 1.5s cubic-bezier(0.25, 1, 0.5, 1); 
}

/* REDUCED BIG CIRCLE SIZE (380px to 320px) */
.shape-big-dark { width: 320px; height: 320px; background: #0f384a; border-radius: 50%; }
.shape-pink-arc { width: 220px; height: 220px; background: transparent; border: 40px solid #4facfe; border-radius: 50%; border-bottom-color: transparent; border-left-color: transparent; }
.shape-yellow-star { width: 70px; height: 70px; background: #fbc531; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.shape-stripes { width: 280px; height: 40px; background: #fbc531; border-top: 15px solid #ff4757; }
.shape-small-circle { width: 50px; height: 50px; background: #ff4757; border-radius: 50%; }
.shape-middle-diamond { width: 70px; height: 70px; background: #4facfe; border-radius: 12px; }

/* --- STATE 1: HOME PAGE --- */
.state-step-1 .shape-big-dark { bottom: 5%; left: 5%; transform: scale(1); }
.state-step-1 .shape-pink-arc { top: 15%; left: 20%; transform: rotate(45deg) scale(1); }
.state-step-1 .shape-yellow-star { top: 38%; left: 8%; transform: rotate(0deg) scale(1); }
.state-step-1 .shape-stripes { bottom: -20px; left: 35%; transform: rotate(-35deg) scale(1); }
.state-step-1 .shape-small-circle { top: 15%; left: 40%; transform: scale(1); }
.state-step-1 .shape-middle-diamond { top: 48%; left: 42%; transform: rotate(45deg) scale(1); }

/* --- STATE 2: MODULES PAGE --- */
.state-step-2 .shape-big-dark { bottom: -10%; left: -10%; transform: scale(1.3); }
.state-step-2 .shape-pink-arc { top: -5%; left: 5%; transform: rotate(90deg) scale(1.2); }
.state-step-2 .shape-yellow-star { top: 50%; left: -5%; transform: rotate(45deg) scale(1.2); }
.state-step-2 .shape-stripes { bottom: 5%; left: 75%; transform: rotate(15deg) scale(1.2); }
.state-step-2 .shape-small-circle { top: 10%; left: 85%; transform: scale(1.4); }
.state-step-2 .shape-middle-diamond { top: 60%; left: 80%; transform: rotate(135deg) scale(1.3); }

/* --- STATE 3: CATEGORY PAGE --- */
.state-step-3 .shape-big-dark { bottom: -20%; left: -20%; transform: scale(1.6); } 
.state-step-3 .shape-pink-arc { top: -15%; left: -5%; transform: rotate(135deg) scale(1.4); }
.state-step-3 .shape-yellow-star { top: 60%; left: -15%; transform: rotate(90deg) scale(1.5); }
.state-step-3 .shape-stripes { bottom: 10%; left: 85%; transform: rotate(45deg) scale(1.4); }
.state-step-3 .shape-small-circle { top: -5%; left: 95%; transform: scale(1.8); }
.state-step-3 .shape-middle-diamond { top: 75%; left: 90%; transform: rotate(225deg) scale(1.6); }

/* --- STATE 4: TEST LIST PAGE --- */
.state-step-4 .shape-big-dark { bottom: -30%; left: -30%; transform: scale(2); opacity: 0.8; } 
.state-step-4 .shape-pink-arc { top: -25%; left: -15%; transform: rotate(180deg) scale(1.6); opacity: 0.8; }
.state-step-4 .shape-yellow-star { top: 70%; left: -25%; transform: rotate(135deg) scale(2); }
.state-step-4 .shape-stripes { bottom: 15%; left: 95%; transform: rotate(60deg) scale(1.6); opacity: 0.8;}
.state-step-4 .shape-small-circle { top: -15%; left: 105%; transform: scale(2.2); }
.state-step-4 .shape-middle-diamond { top: 85%; left: 100%; transform: rotate(315deg) scale(2); opacity: 0.8;}

/* --- STATE 5: STUDENT FORM --- */
.state-step-5 .shape-big-dark { bottom: -40%; left: -40%; transform: scale(2.5); opacity: 0.4; } 
.state-step-5 .shape-pink-arc { top: -35%; left: -25%; transform: rotate(225deg) scale(2); opacity: 0.4; }
.state-step-5 .shape-yellow-star { top: 80%; left: -35%; transform: rotate(180deg) scale(2.5); opacity: 0.4; }
.state-step-5 .shape-stripes { bottom: 20%; left: 105%; transform: rotate(90deg) scale(2); opacity: 0.4; }
.state-step-5 .shape-small-circle { top: -25%; left: 115%; transform: scale(3); opacity: 0.4; }
.state-step-5 .shape-middle-diamond { top: 95%; left: 110%; transform: rotate(360deg) scale(2.5); opacity: 0.4; }

input:focus { outline: none; border-color: #ff4757; box-shadow: 0 0 8px rgba(255,71,87,0.3); }

/* ================= MAIN CONTENT LAYOUT ================= */
.main-container {
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

.content-step {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    transition: opacity 0.5s ease, transform 0.5s ease;
    z-index: 20;
}

.step-1-layout { justify-content: flex-end; align-items: center; padding-right: 8%; }
.step-center-layout { justify-content: center; align-items: center; }

/* FIX: LEFT-ALIGNED TEXT BOX */
.text-box-right { width: 100%; max-width: 600px; text-align: left; }
.text-box-center { width: 100%; max-width: 600px; text-align: center; }

.main-title { font-size: clamp(3.5rem, 6vw, 5.5rem); font-weight: 800; color: #0f384a; line-height: 1; margin-bottom: 5px; }
.sub-title { font-size: clamp(1.2rem, 2.5vw, 1.6rem); font-weight: 700; color: #ff4757; letter-spacing: 2px; margin-bottom: 30px; white-space: nowrap; }

/* FIX: LEFT-ALIGNED PARAGRAPH */
.desc-wrapper { display: flex; justify-content: flex-start; }
.description { 
    font-size: 1.1rem; 
    color: #334155; 
    font-weight: 500; 
    max-width: 480px; 
    margin-bottom: 20px; 
    line-height: 1.6; 
}
.center-text { margin: 0 auto 25px auto; text-align: center; }

/* NEW: TRUST BADGE CSS */
.trust-badge {
    font-size: 0.95rem;
    color: #475569;
    font-weight: 600;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* FIX: LEFT-ALIGNED BUTTON */
.btn-container-left { display: flex; justify-content: flex-start; margin-top: 10px; }
.btn-container-center { display: flex; justify-content: center; margin-top: 20px; }

.btn {
    background: #ff4757; color: white; border: none; padding: 15px 45px;
    font-size: 1.2rem; font-weight: 700; border-radius: 30px; cursor: pointer;
    box-shadow: 0 8px 20px rgba(255, 71, 87, 0.3); transition: all 0.3s ease;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(255, 71, 87, 0.5); }

.modules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; width: 100%; }

/* --- UPDATED MODULE BUTTON FOR CODE + SUBJECT NAME --- */
.btn-module { 
    background: #0f384a; 
    width: 100%; 
    height: 100%; 
    padding: 20px 15px; 
    border-radius: 10px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 120px; 
    gap: 8px;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.mod-code {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.mod-name {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.9;
    line-height: 1.3;
    color: #e2e8f0;
}

.btn-category { background: #0f384a; width: 100%; max-width: 450px; margin: 0 auto 15px auto; display: block; }
.btn-back { background: transparent; color: #0f384a; border: 2px solid #0f384a; box-shadow: none; padding: 10px 40px; }
.btn-back:hover { background: #0f384a; color: white; }

.active { opacity: 1; transform: translateY(0); pointer-events: all; }
.hidden { opacity: 0; transform: translateY(20px); pointer-events: none; }

/* ================= TOP NAVBAR & LOGO (UPDATED) ================= */
.top-nav {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100; 
}

.nav-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f384a;
}
.nav-logo span {
    color: #ff4757;
}

.btn-nav {
    background: rgba(255, 255, 255, 0.9); color: #0f384a; border: 2px solid #0f384a;
    padding: 10px 25px; font-size: 1rem; font-weight: 700; border-radius: 30px;
    cursor: pointer; backdrop-filter: blur(5px); transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.btn-nav:hover { background: #0f384a; color: #ffffff; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15, 56, 74, 0.2); }

/* ================= SLIDING AUTH PANEL STYLES ================= */
.mobile-auth-toggle {
    display: none;
}

.auth-outer-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px;
}

.auth-container-slide {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
    overflow: hidden;
    width: 860px;
    max-width: 95%;
    min-height: 520px;
}

.form-panel {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.6s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 35px;
    background-color: #ffffff;
    text-align: center;
    width: 50%;
}

.signin-panel { left: 0; z-index: 2; }
.signup-panel { left: 0; opacity: 0; z-index: 1; }

.signup-scroll-area {
    max-height: 360px;
    overflow-y: auto;
    width: 100%;
    padding-right: 4px;
}

.signup-scroll-area::-webkit-scrollbar { width: 4px; }
.signup-scroll-area::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* Slide Animation States */
.auth-container-slide.right-panel-active .signin-panel {
    transform: translateX(100%);
    opacity: 0;
}

.auth-container-slide.right-panel-active .signup-panel {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    animation: show 0.6s;
}

@keyframes show {
    0%, 49% { opacity: 0; z-index: 1; }
    50%, 100% { opacity: 1; z-index: 5; }
}

/* Sliding Overlay Box */
.overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.6s ease-in-out;
    z-index: 100;
}

.auth-container-slide.right-panel-active .overlay-container {
    transform: translateX(-100%);
}

.overlay {
    background: linear-gradient(to right, #ff4757, #ff6b81);
    color: #ffffff;
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.auth-container-slide.right-panel-active .overlay {
    transform: translateX(50%);
}

.overlay-panel {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 35px;
    text-align: center;
    top: 0;
    height: 100%;
    width: 50%;
    transition: transform 0.6s ease-in-out;
}

.overlay-left { transform: translateX(-20%); }
.auth-container-slide.right-panel-active .overlay-left { transform: translateX(0); }
.overlay-right { right: 0; transform: translateX(0); }
.auth-container-slide.right-panel-active .overlay-right { transform: translateX(20%); }

.btn-ghost {
    background: transparent;
    border: 2px solid #ffffff;
    color: #ffffff;
    padding: 10px 30px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.btn-ghost:hover { background: #ffffff; color: #ff4757; }

/* ================= MOBILE RESPONSIVE & TOGGLE FIXES ================= */
body.on-auth-page .top-nav {
    display: none !important;
}

@media (max-width: 768px) {
    body { overflow-y: auto; height: auto; }
    .main-container { height: auto; min-height: 100vh; }
    
    .auth-container-slide {
        width: 100%;
        min-height: 610px;
        padding-top: 75px !important;
    }

    .form-panel .sub-title, 
    .form-panel .description {
        display: none !important; 
    }

    .overlay-container { display: none !important; }
    
    .mobile-auth-toggle {
        display: flex !important;
        position: absolute;
        top: 15px;
        left: 50%;
        transform: translateX(-50%);
        background: #f1f2f6;
        border-radius: 20px;
        padding: 4px;
        z-index: 200;
        width: 85%;
        max-width: 260px;
    }

    .mob-tab-btn {
        flex: 1;
        background: transparent;
        border: none;
        padding: 7px 10px;
        font-weight: 600;
        font-family: 'Poppins', sans-serif;
        cursor: pointer;
        border-radius: 16px;
        color: #666;
        font-size: 11px;
        transition: 0.3s;
        width: 50%;
        text-align: center;
    }

    .mob-tab-btn.active {
        background: #0f384a;
        color: white;
    }
    
    .form-panel {
        width: 100% !important;
        padding: 10px 20px !important;
        position: relative !important;
        display: none;
    }

    .form-panel.mobile-active {
        display: flex !important;
        opacity: 1 !important;
        transform: translateX(0) !important;
        z-index: 10;
    }
    
    .step-1-layout, .step-center-layout { justify-content: center; padding: 20px 5%; }
    .text-box-right, .text-box-center { text-align: center; background: rgba(255, 255, 255, 0.85); padding: 25px 15px; border-radius: 20px; backdrop-filter: blur(5px); }
    
    /* Mobile Fixes for New Layout */
    .top-nav { padding: 15px 20px; }
    .nav-logo { font-size: 1.4rem; }
    .desc-wrapper { justify-content: center; }
    .btn-container-left { justify-content: center; }
    .trust-badge { justify-content: center; }
    .btn-nav { padding: 8px 18px; font-size: 0.9rem; }

    .main-title { font-size: clamp(2.2rem, 10vw, 3.4rem); }
    .sub-title { white-space: normal; line-height: 1.35; }

    .step-1-layout { padding-top: 90px; }
    body:not(.on-auth-page) .step-center-layout { padding-top: 90px; }

    .step-1-layout,
    body:not(.on-auth-page) .step-center-layout {
        align-items: flex-start;
    }
}

/* Custom Loading Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ================= SYLLABUS PREVIEW BOX FOR MARKETING PAGE ================= */
.syllabus-preview-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px 30px;
    max-height: 250px;
    overflow-y: auto;
    margin: 0 auto 20px auto;
    max-width: 450px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.syllabus-preview-box::-webkit-scrollbar { width: 6px; }
.syllabus-preview-box::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.syllabus-item {
    padding: 12px 0px; 
    border-bottom: 1px solid #f1f5f9;
    color: #0f384a;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    text-align: left;
}

.syllabus-item:last-child { border-bottom: none; }
.syllabus-icon { flex-shrink: 0; margin-top: 2px; }