/* ==========================================================================
   GLOBAL SETTINGS & VARIABLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-image: url('/assets/images/landingpage.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #000000;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   DYNAMIC HEADER
   ========================================================================== */
header {
    background-color: rgba(235, 243, 250, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    padding: 10px 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 88px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    margin-right: auto; /* Pushes the logo as far left as possible, independent of nav links */
    padding-left: 20px; /* Spacially matches layout design constraints at the far edge */
}

.logo-img {
    height: 70px;
    width: auto;
    display: block;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: #003344;
    font-weight: 700;
    font-size: 16px;
}

/* ==========================================================================
   UNIVERSAL LAYOUT (Shared between Index and Login)
   ========================================================================== */
.hero-container {
    max-width: 1200px;
    width: 100%;
    margin: auto;
    padding: 40px 8%;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 80px; /* Enhanced gap to prevent text and card/image crowding */
    align-items: center;
}

.content-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1 {
    font-size: 64px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 25px;
    letter-spacing: -1px;
}

.text-green {
    color: #139C38; /* Unified vibrant green across both screens */
    display: block;
}

.description {
    font-size: 16px;
    line-height: 1.6;
    color: #2D2D2D;
    max-width: 460px;
}

.visual-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.hero-image {
    width: 100%;
    max-width: 480px;
    height: auto;
    object-fit: contain;
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* Homepage CTA Button */
.btn-cta {
    display: inline-block;
    background: linear-gradient(135deg, #00D2FF 0%, #00FF87 100%);
    color: #FFFFFF;
    font-size: 22px;
    font-weight: 700;
    padding: 14px 45px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.2);
    transition: transform 0.2s;
    margin-top: 20px;
}

.btn-cta:hover {
    transform: translateY(-2px);
}

/* Interactive Authentication Card */
.auth-card {
    background: #FFFFFF;
    border-radius: 16px; /* Smoother curve matching modern web aesthetics */
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.auth-toggle {
    position: relative;
    display: flex;
    background: #D5D5D5;
    border-radius: 25px;
    padding: 4px;
    margin-bottom: 30px;
}

.toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(90deg, #00D0FF 0%, #1CE8C8 50%, #38FF92 100%);
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
    z-index: 0;
}

.toggle-slider.slide-right {
    transform: translateX(100%);
}

.toggle-btn {
    position: relative;
    z-index: 1;
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s ease;
    color: #A0A0A0;
}

.toggle-btn.active {
    color: #FFFFFF;
}

.form-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: #111111;
    margin-bottom: 6px;
}

.form-header p {
    font-size: 14px;
    color: #666666;
    margin-bottom: 28px;
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 22px;
}

.input-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 8px;
}

.input-group input,
.input-group select {
    background: #EDEAE4;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 14px;
    color: #333333;
    outline: none;
    width: 100%;
    display: block;
    height: 48px; /* Hard locking the height ensures all fields match perfectly */
    box-sizing: border-box;
}

/* Reduce bottom margins on sign-up fields to save vertical space */
#signUpPanel .input-group {
    margin-bottom: 14px; /* Reduced from 22px to bring fields closer together */
}

/* Give the Next button a tiny bit of breathing room from the gender selector */
#signUpPanel .button-wrapper {
    margin-top: 20px;
}

/* --- Step 2 Elements Stylings --- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    text-decoration: none;
    margin-bottom: 15px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #139C38;
}

#signUpStep2Panel .input-group {
    margin-bottom: 14px;
}

/* --- Step 3 Verification Elements Stylings --- */
.verification-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.verification-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.verification-icon svg {
    width: 100%;
    height: 100%;
    transform: rotate(-15deg); /* Matches the dynamic tilt in your design */
}

.centered-header h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.centered-header p {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 25px;
}

/* 6-box input alignment grid */
.otp-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 25px;
    width: 100%;
}

.otp-input {
    width: 48px;
    height: 56px;
    background: #FFFFFF;
    border: 1px solid #CCCCCC;
    border-radius: 12px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #111111;
    outline: none;
    transition: border-color 0.2s;
}

.otp-input:focus {
    border-color: #1CE8C8;
    box-shadow: 0 0 0 2px rgba(28, 232, 200, 0.1);
}

/* Timer and Resend alignments */
.timer-container {
    margin-bottom: 30px;
}

.timer-text {
    font-size: 14px;
    color: #333333;
    font-weight: 500;
    margin-bottom: 6px;
}

.resend-link {
    font-size: 14px;
    color: #139C38;
    text-decoration: none;
    font-weight: 700;
}

.resend-link:hover {
    text-decoration: underline;
}

.btn-verify {
    border-radius: 12px; /* Square-ish modern pill button matching design */
}

/* --- Step 4 Success Elements Stylings --- */
.success-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    width: 90px;
    height: 90px;
    margin-bottom: 25px;
}

.success-icon svg {
    width: 100%;
    height: 100%;
}

.btn-success-nav {
    width: auto;
    min-width: 200px;
    padding: 14px 40px;
    border-radius: 12px;
    margin-top: 10px;
}

/* --- Forgot Password Extras --- */
.back-home-wrapper {
    margin-top: 25px;
    border-top: 1px solid #EDEAE4;
    padding-top: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.back-home-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #333333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-home-link:hover {
    color: #139C38;
}

.footer-back-wrapper {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.back-to-login-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #333333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-to-login-link:hover {
    color: #139C38;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper input {
    padding-right: 40px;
}

.toggle-password-visibility {
    position: absolute;
    right: 14px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.eye-icon {
    width: 100%;
    height: 100%;
    color: #666666; /* Elegant gray that matches the placeholder */
    transition: color 0.2s ease;
}

.eye-icon:hover {
    color: #139C38; /* Changes to your brand green when hovered */
}

.forgot-link {
    display: inline-block;
    font-size: 13px;
    color: #139C38; /* Swapped to match the brand typography green */
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 28px;
}

.forgot-link:hover {
    text-decoration: underline;
}


/* "Forgot your username?" under the Username box - the same look as
   .forgot-link above. It has its OWN class on purpose: script.js finds the
   password link with querySelector('.forgot-link'), which takes the first
   match on the page, and this link comes first. */
.forgot-username-link {
    display: inline-block;
    font-size: 13px;
    color: #139C38;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 22px;
}

.forgot-username-link:hover {
    text-decoration: underline;
}

/* The recovered username on the last "Forgot your username?" screen
   (feat/forgot-username): large, in the same grey box as the inputs so it
   reads as "this is what you type". */
.recovered-username {
    width: 100%;
    margin: 4px 0 8px;
    padding: 16px 14px;
    border-radius: 8px;
    background: #EDEAE4;
    color: #111111;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-align: center;
    overflow-wrap: anywhere;
    user-select: all;
}

/* Action Button */
.btn-login {
    width: 100%;
    border: none;
    padding: 15px;
    border-radius: 25px;
    background: linear-gradient(90deg, #00D0FF 0%, #1CE8C8 50%, #38FF92 100%);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(28, 232, 200, 0.3);
    transition: transform 0.1s ease;
}

.btn-login:active {
    transform: scale(0.98);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 900px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 50px;
        padding-top: 20px;
    }
    h1 { font-size: 48px; }
    .description { margin: 0 auto; }
    header { flex-direction: column; gap: 15px; }
    .auth-card { margin: 0 auto; }
}

.dashboard-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 32px;
}

.dashboard-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    color: #475569;
    transition: color 0.2s ease;
}

.dashboard-nav-link:hover {
    color: #10b981;
}

.dashboard-nav-link.active {
    color: #10b981;
}

.dashboard-nav-link svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   SIGN UP COMPONENT MODIFICATIONS
   ========================================================================== */

/* --- Select & Date Styling fixes to match inputs --- */
input[type="date"], select {
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    color: #666666;
}

select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    cursor: pointer;
}

/* Form panel wrapper layout rules */
.button-wrapper {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.btn-next {
    width: auto;
    min-width: 140px;
    padding: 12px 35px;
}

/* ==========================================================================
   DASHBOARD ARCHITECTURE STYLINGS
   ========================================================================== */
.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #003344;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.icon-btn:hover {
    transform: scale(1.1);
}

/* Dashboard Parent Wrapper layout */
.dashboard-container {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 3%;
}

.dashboard-intro {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: flex-start;
    margin-bottom: 50px;
}

.intro-desc-col h3 {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #000000;
    margin-bottom: 8px;
}

.intro-desc-col p {
    font-size: 15px;
    line-height: 1.6;
    color: #333333;
}

/* Learning Path Grid Architecture */
.paths-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.path-card {
    background: #E3DEC1; /* Matched darker canvas block layout blend background */
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-image-wrapper {
    width: 100%;
    height: 240px;
    overflow: hidden;
}

.card-banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: #ffffff;
}

/* Styled Badges */
.badge {
    align-self: flex-start;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 15px;
}

.badge-learn {
    background: #FDBA74;
    color: #C2410C;
}

.badge-practice {
    background: #FCA5A5;
    color: #B91C1C;
}

.card-body h2 {
    font-size: 26px;
    font-weight: 800;
    color: #111111;
    margin-bottom: 12px;
}

.card-body p {
    font-size: 14px;
    line-height: 1.6;
    color: #2D2D2D;
    margin-bottom: 25px;
    flex-grow: 1;
}

/* Arrow Navigation Action Links */
.card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #139C38;
    font-weight: 700;
    font-size: 15px;
    transition: gap 0.2s;
}

.card-link:hover {
    gap: 10px;
}

/* Component Success Vector Adjustments */
.signin-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px auto;
}

/* Dashboard Responsive Layout rules overrides */
@media (max-width: 900px) {
    .dashboard-intro {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .paths-grid {
        grid-template-columns: 1fr;
    }
}

/* Disabled button styling during API calls */
.btn-loading {
    opacity: 0.75 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

/* Spinner Icon */
.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}
/* Container wrapper to bound the width to the OTP input boxes */
.otp-wrapper {
    display: inline-block;
    text-align: left;
    margin: 0 auto;
}

/* Left-align the checkbox to the edge of the first box */
.show-otp-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
}

.show-otp-container input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #139C38;
}

.show-otp-container label {
    cursor: pointer;
    user-select: none;
}

.password-wrapper + .js-error-message ~ #forgotConfirmPassword-match,
.password-wrapper + .js-error-message ~ #confirmPassword-match {
    display: none !important;
}

/* Module Editor Layout Styles */
.module-editor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid #f3f4f6;
    background-color: #ffffff;
}

.module-editor-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.module-editor-header i {
    font-size: 1rem;
    color: #4b5563;
}

/* Formatting Toolbar */
.editor-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 10px 24px;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-group button {
    background: transparent;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    color: #4b5563;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.toolbar-group button:hover {
    background-color: #e5e7eb;
    color: #028090;
}

.headings-group button {
    color: #028090;
    font-weight: 700;
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background-color: #d1d5db;
}

/* Editor Textarea Body */
.editor-body {
    padding: 24px;
    background-color: #ffffff;
}

.form-textarea {
    width: 100%;
    min-height: 350px;
    border: none;
    outline: none;
    resize: vertical;
    font-family: inherit;
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.6;
    background: transparent;
}

.form-textarea::placeholder {
    color: #9ca3af;
}

/* ==========================================================================
   feat/login-signup-redirect: LOGIN PAGE HELPERS
   Replace the inline style="" that used to be in login.html and the
   element.style.* colors that used to be set in script.js.
   Prefixed "auth-" so they can't clash with other pages using style.css.
   ========================================================================== */

/* Panels / checker boxes that start hidden. script.js still shows a
   panel with style.display (showPanel), which always beats this class. */
.auth-hidden {
    display: none;
}

.auth-form--full {
    width: 100%;
}

.auth-text-left {
    text-align: left;
}

/* Square-ish button variant used on the Forgot Password screens
   (was style="border-radius: 12px; margin-top: 10px;") */
.auth-btn-rounded {
    border-radius: 12px;
}

.auth-btn-spaced {
    margin-top: 10px;
}

/* Emphasized email / timer text inside a sentence */
.auth-text-strong {
    font-weight: 600;
}

.auth-text-dark {
    color: #111111;
}

/* Forgot Password OTP timer (slightly tighter than the sign-up one) */
.timer-container--compact {
    margin-bottom: 20px;
    font-size: 14px;
}

.timer-text--muted {
    color: #666666;
    margin-bottom: 4px;
}

.resend-link--regular {
    font-weight: 600;
}

/* Resend link while the countdown runs / while sending */
.resend-link--disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: default;
}

/* Inline red error under a field (was set in showInlineError() via JS) */
.js-error-message {
    color: #e02424;
    font-size: 14px;
    margin-top: 8px;
}

/* Password strength checklist */
.password-strength-box {
    margin-top: 6px;
    font-size: 13px;
    text-align: left;
}

.password-req {
    color: #e02424;
    margin: 2px 0;
}

.password-req.password-req--met {
    color: #0e9f6e;
}

/* "Passwords match" indicator */
.password-match {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 500;
}

.password-match.password-match--ok {
    color: #0e9f6e;
}

.password-match.password-match--bad {
    color: #e02424;
}

/* OTP boxes after checking the code. Two classes so they still show
   while the first box is focused again after a wrong code. */
.otp-input.otp-input--correct {
    border-color: #0e9f6e;
    background-color: #ecfdf5;
}

.otp-input.otp-input--wrong {
    border-color: #e02424;
    background-color: #fef2f2;
}


/* ==========================================================================
   feat/login-signup-redirect: SIGN-UP LINKS + CREATE-EMAIL POPUP
   ========================================================================== */

/* Small helper line under a field, e.g. under the sign-up Email field */
.auth-field-hint {
    font-size: 13px;
    color: #666666;
    margin-top: 8px;
}

/* Green text link - same look as .forgot-link */
.auth-inline-link {
    color: #139C38;
    font-weight: 600;
    text-decoration: none;
}

.auth-inline-link:hover {
    text-decoration: underline;
}

/* "No account yet? Sign up" line under a login / forgot-password error */
.auth-signup-hint {
    font-size: 13px;
    color: #666666;
    margin-top: 4px;
}

/* Popup backdrop - above the sticky header (z-index 1000) */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
}

.auth-modal-overlay.auth-hidden {
    display: none;
}

/* Same card look as .auth-card */
.auth-modal-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 40px;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    border: none;
    background: none;
    font-size: 24px;
    line-height: 1;
    color: #666666;
    cursor: pointer;
    transition: color 0.2s ease;
}

.auth-modal-close:hover {
    color: #139C38;
}

/* Gmail / Outlook / Yahoo - styled like the login inputs (#EDEAE4) */
.email-provider-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.email-provider-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #EDEAE4;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    text-decoration: none;
    transition: color 0.2s ease, box-shadow 0.2s ease;
}

.email-provider-btn:hover,
.email-provider-btn:focus-visible {
    color: #139C38;
    box-shadow: inset 0 0 0 1px #1CE8C8;
    outline: none;
}

.email-help-note {
    margin-top: 18px;
    font-size: 13px;
    line-height: 1.5;
    color: #666666;
}

@media (max-width: 480px) {
    .auth-modal-card {
        padding: 28px 22px;
    }
}