/* =====================================================================
   Sequential Spelling v2 — Custom Styles
   Bootstrap 5 base · Inter font · Teal + Orange palette
   ===================================================================== */

/* =====================================================================
   1. Bootstrap primary-color override
   Setting these here means every Bootstrap component (btn-primary,
   alert-primary, form focus rings, breadcrumb links, etc.) automatically
   uses the site's teal without any per-component hacks.
   ===================================================================== */
:root {
    --bs-primary:                #0d9488;
    --bs-primary-rgb:            13, 148, 136;
    --bs-link-color:             #0d9488;
    --bs-link-hover-color:       #0f766e;
    --bs-link-color-rgb:         13, 148, 136;
    --bs-link-hover-color-rgb:   15, 118, 110;
    --bs-focus-ring-color:       rgba(13, 148, 136, 0.25);
}

.btn-primary {
    --bs-btn-bg:                 #0d9488;
    --bs-btn-border-color:       #0d9488;
    --bs-btn-hover-bg:           #0f766e;
    --bs-btn-hover-border-color: #0f766e;
    --bs-btn-active-bg:          #115e59;
    --bs-btn-active-border-color:#115e59;
    --bs-btn-disabled-bg:        #0d9488;
    --bs-btn-disabled-border-color:#0d9488;
    --bs-btn-focus-shadow-rgb:   13, 148, 136;
}

.btn-outline-primary {
    --bs-btn-color:              #0d9488;
    --bs-btn-border-color:       #0d9488;
    --bs-btn-hover-bg:           #0d9488;
    --bs-btn-hover-border-color: #0d9488;
    --bs-btn-hover-color:        #fff;
    --bs-btn-active-bg:          #0f766e;
    --bs-btn-active-border-color:#0f766e;
    --bs-btn-active-color:       #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 0.25rem rgba(13, 148, 136, 0.22);
}
.form-check-input:checked {
    background-color: #0d9488;
    border-color: #0d9488;
}
.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 148, 136, 0.22);
}

/* =====================================================================
   2. Site design tokens
   ===================================================================== */
:root {
    /* Primary — teal */
    --ss-primary:      #0d9488;
    --ss-primary-dk:   #0f766e;
    --ss-primary-lt:   #ccfbf1;
    --ss-primary-mid:  #5eead4;

    /* Accent — amber/gold (CTA, submit, progress) */
    --ss-accent:       #fbbf24;
    --ss-accent-dk:    #d97706;
    --ss-accent-lt:    #fef3c7;

    /* Semantic */
    --ss-green:        #16a34a;
    --ss-green-lt:     #dcfce7;
    --ss-red:          #dc2626;
    --ss-red-lt:       #fee2e2;
    --ss-amber:        #d97706;
    --ss-amber-lt:     #fef3c7;

    /* Neutrals */
    --ss-bg:           #f0fdfa;   /* teal-50 — just barely tinted, ties to palette */
    --ss-slate-100:    #f1f5f9;
    --ss-slate-200:    #e2e8f0;
    --ss-slate-600:    #475569;
    --ss-slate-800:    #1e293b;

    /* Navbar gradient */
    --ss-nav-from:     #0f766e;   /* teal-700 */
    --ss-nav-to:       #0369a1;   /* sky-700  */
    --ss-nav-trim:     #2dd4bf;   /* teal-400 — accent trim line */
}

/* =====================================================================
   3. Base
   ===================================================================== */
body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--ss-bg);
    color: var(--ss-slate-800);
    padding-top: 70px;
}

/* =====================================================================
   4. Navbar
   ===================================================================== */
.ss-navbar {
    background: linear-gradient(135deg, var(--ss-nav-from) 0%, var(--ss-nav-to) 100%);
    border-bottom: 2px solid var(--ss-nav-trim);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
}

.ss-navbar .navbar-brand {
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

/* Two-tone logotype */
.brand-seq   { color: #99f6e4; }           /* teal-200 — lighter, clearly "Sequential" */
.brand-spell { color: #ffffff; font-weight: 800; }

.ss-navbar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    transition: color 0.15s;
}
.ss-navbar .nav-link:hover { color: #fff !important; }

.ss-navbar .dropdown-menu {
    border: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

/* Hamburger icon visible on gradient background */
.ss-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.45);
}
.ss-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* CTA button used in the navbar ("Get Started Free") and hero */
.btn-accent {
    background: linear-gradient(135deg, var(--ss-accent), var(--ss-accent-dk));
    border: 2px solid rgba(255, 255, 255, 0.35);
    color: #1c1917;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.40), 0 1px 4px rgba(0, 0, 0, 0.10);
    transition: all 0.15s;
}
.btn-accent:hover {
    color: #1c1917;
    border-color: rgba(255, 255, 255, 0.60);
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(217, 119, 6, 0.55), 0 2px 6px rgba(0, 0, 0, 0.12);
}
.btn-accent:active { transform: translateY(0); }

/* =====================================================================
   5. Typography helpers
   ===================================================================== */
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

/* =====================================================================
   6. Cards
   ===================================================================== */
.ss-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 16px rgba(0, 0, 0, 0.05);
    padding: 2rem;
}

.ss-card-sm {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 1.25rem 1.5rem;
}

/* =====================================================================
   7. Lesson interface
   ===================================================================== */
.lesson-header {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ss-slate-600);
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.word-counter {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--ss-primary);
    line-height: 1;
}
.word-counter span {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--ss-slate-600);
}

/* Progress bar — amber: energetic, distinct from teal interactive elements */
.progress-track {
    height: 8px;
    border-radius: 4px;
    background: var(--ss-slate-200);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--ss-accent), var(--ss-accent-dk));
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================================
   8. TTS controls
   ===================================================================== */
.tts-controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-tts {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid transparent;
    transition: all 0.15s;
    cursor: pointer;
}

.btn-tts-word {
    background: var(--ss-primary);
    color: #fff;
    border-color: var(--ss-primary);
}
.btn-tts-word:hover {
    background: var(--ss-primary-dk);
    border-color: var(--ss-primary-dk);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}
.btn-tts-word:active { transform: translateY(0); }

.btn-tts-sentence {
    background: #fff;
    color: var(--ss-primary);
    border-color: var(--ss-primary);
}
.btn-tts-sentence:hover {
    background: var(--ss-primary-lt);
    color: var(--ss-primary-dk);
    transform: translateY(-1px);
}

@keyframes tts-pulse {
    0%, 100% { box-shadow: 0 0 0 0   rgba(13, 148, 136, 0.50); }
    50%       { box-shadow: 0 0 0 10px rgba(13, 148, 136, 0);   }
}
.tts-speaking { animation: tts-pulse 1.2s ease-in-out infinite; }

/* =====================================================================
   9. Spell input & submit
   ===================================================================== */
.spell-input {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.08em;
    border: 3px solid var(--ss-slate-200);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}
.spell-input:focus {
    outline: none;
    border-color: var(--ss-primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
}

/* Amber submit — contrasts with teal UI, draws the eye as the primary action */
.btn-submit-spell {
    padding: 0.8rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 2rem;
    background: linear-gradient(135deg, var(--ss-accent), var(--ss-accent-dk));
    border: none;
    color: #1c1917;
    transition: all 0.15s;
    box-shadow: 0 3px 10px rgba(217, 119, 6, 0.35);
}
.btn-submit-spell:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.45);
    color: #1c1917;
}
.btn-submit-spell:active { transform: translateY(0); }

/* =====================================================================
   10. Result states
   ===================================================================== */
.result-correct {
    background: var(--ss-green-lt);
    border-left: 4px solid var(--ss-green);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
}
.result-incorrect {
    background: var(--ss-red-lt);
    border-left: 4px solid var(--ss-red);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
}

.result-word {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.result-sentence {
    font-size: 1.1rem;
    color: var(--ss-slate-600);
    font-style: italic;
    margin-top: 0.25rem;
}

/* =====================================================================
   11. Flash alerts
   ===================================================================== */
.ss-flash {
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1.05rem;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* =====================================================================
   12. Gradebook / review-day table
   ===================================================================== */
.gradebook-table th {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ss-slate-600);
    border-bottom: 2px solid var(--ss-slate-200);
}
.gradebook-table td { vertical-align: middle; font-size: 1rem; }

.badge-correct   { background: var(--ss-green); color: #fff; }
.badge-incorrect { background: var(--ss-red);   color: #fff; }

/* =====================================================================
   13. Voice selection (instructor page)
   ===================================================================== */
.voice-card {
    border: 2px solid var(--ss-slate-200);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: #fff;
}
.voice-card:hover  { border-color: var(--ss-primary); background: var(--ss-primary-lt); }
.voice-card.active { border-color: var(--ss-primary); background: var(--ss-primary-lt); }
.voice-card .voice-name { font-weight: 600; }
.voice-card .voice-lang { font-size: 0.8rem; color: var(--ss-slate-600); }

/* =====================================================================
   14. Utilities
   ===================================================================== */
/* Legacy alias kept so existing PHP files don't need changes */
.text-indigo  { color: var(--ss-primary); }
.bg-indigo    { background: var(--ss-primary); }

.text-primary { color: var(--ss-primary) !important; }
.bg-primary   { background-color: var(--ss-primary) !important; }

.review-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--ss-accent-lt);
    color: var(--ss-accent-dk);
    border-radius: 2rem;
    padding: 0.2rem 0.75rem;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =====================================================================
   15. Inner page hero (compact — used on all static pages)
   ===================================================================== */
.page-hero {
    background: linear-gradient(150deg, var(--ss-nav-from) 0%, var(--ss-nav-to) 100%);
    margin-top: -70px;
    padding: calc(3rem + 70px) 0 2.5rem;
    color: #fff;
}
.page-hero h1 {
    font-size: clamp(1.5rem, 4vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}
.page-hero .lead {
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
    margin: 0;
}
.page-hero .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0.85rem 0 0;
    font-size: 0.85rem;
    --bs-breadcrumb-divider-color: rgba(255, 255, 255, 0.45);
    --bs-breadcrumb-item-active-color: rgba(255, 255, 255, 0.90);
}
.page-hero .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
}
.page-hero .breadcrumb-item a:hover { color: #fff; }

/* =====================================================================
   16. Home page
   ===================================================================== */

/* Hero — same gradient as navbar so they read as one unified band.
   Negative margin pulls section up to cover body padding-top gap behind navbar. */
.hero-section {
    background: linear-gradient(150deg, var(--ss-nav-from) 0%, var(--ss-nav-to) 100%);
    margin-top: -70px;
    padding: calc(6rem + 70px) 0 4.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

/* Scrolling word-cloud background — desktop only. Content is duplicated so the
   translateY(-50%) animation loops seamlessly without a jump. */
.hero-words-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    user-select: none;
}

.hero-words-scroll {
    display: flex;
    flex-direction: column;
    opacity: 0.10;
    color: #fff;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
    letter-spacing: -0.01em;
    animation: heroWordsScroll 28s linear infinite;
}

@keyframes heroWordsScroll {
    from { transform: translateY(0); }
    to   { transform: translateY(-50%); }
}

.hero-headline {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1.1rem;
}

.hero-sub {
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 1.75rem;
    max-width: 520px;
}

/* Secondary hero button — white fill with teal text; solid but not the primary CTA */
.btn-hero-secondary {
    background: #fff;
    color: var(--ss-primary-dk);
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.0);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    transition: all 0.15s;
}
.btn-hero-secondary:hover {
    background: #fff;
    color: var(--ss-primary-dk);
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.24);
}
.btn-hero-secondary:active { transform: translateY(0); }

/* Stat pills under the headline */
.hero-stats {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}
.hero-stat {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.30);
    border-radius: 2rem;
    padding: 0.3rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    backdrop-filter: blur(4px);
}

/* Login card — white card floating in the hero */
.login-card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
    padding: 2.25rem 2rem;
    color: var(--ss-slate-800);
}

.login-card-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ss-slate-800);
    margin-bottom: 0.15rem;
}

.login-card-sub {
    font-size: 0.88rem;
    color: var(--ss-slate-600);
    margin-bottom: 1.5rem;
}

.login-card .form-label {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--ss-slate-600);
    margin-bottom: 0.3rem;
}

.login-card .form-control {
    border: 2px solid var(--ss-slate-200);
    border-radius: 0.6rem;
    font-size: 1rem;
    padding: 0.6rem 0.85rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.btn-login {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--ss-primary), var(--ss-primary-dk));
    border: none;
    color: #fff;
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.30);
    transition: all 0.15s;
}
.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(13, 148, 136, 0.40);
    color: #fff;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ss-slate-600);
    font-size: 0.8rem;
    margin: 1.1rem 0;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ss-slate-200);
}

/* Features section */
.features-section {
    padding: 5rem 0;
    background: #fff;
}

.feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.25rem;
}
.feature-icon-teal   { background: var(--ss-primary-lt); color: var(--ss-primary); }
.feature-icon-violet { background: var(--ss-accent-lt);  color: var(--ss-accent);  }
.feature-icon-green  { background: var(--ss-green-lt);   color: var(--ss-green);   }
.feature-icon-amber  { background: var(--ss-amber-lt);   color: var(--ss-amber);   }

.feature-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}
.feature-card p {
    font-size: 0.95rem;
    color: var(--ss-slate-600);
    line-height: 1.65;
    margin: 0;
}

/* How it works section */
.how-section {
    padding: 5rem 0;
    background: var(--ss-bg);
}

.how-section h2,
.features-section h2,
.testimonial-section h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.section-sub {
    color: var(--ss-slate-600);
    font-size: 1.05rem;
    margin-bottom: 3rem;
}

.step-card {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1.5rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 4px 12px rgba(0,0,0,0.05);
    height: 100%;
}

.step-number {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ss-nav-from), var(--ss-nav-to));
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-body h5 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}
.step-body p {
    font-size: 0.9rem;
    color: var(--ss-slate-600);
    margin: 0;
    line-height: 1.6;
}

/* Testimonial section */
.testimonial-section {
    padding: 5rem 0;
    background: #fff;
}

.testimonial-block {
    background: var(--ss-bg);
    border-left: 4px solid var(--ss-primary);
    border-radius: 0 1rem 1rem 0;
    padding: 1.75rem 2rem;
}

.testimonial-quote {
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--ss-slate-800);
    font-style: italic;
    margin-bottom: 1rem;
}

.testimonial-source {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ss-primary);
}

/* Footer CTA section */
.cta-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--ss-accent-dk), var(--ss-accent));
    color: #fff;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.cta-section p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 2rem;
}

.btn-cta-white {
    background: #fff;
    color: var(--ss-accent-dk);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.9rem 2.5rem;
    border-radius: 2rem;
    border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
}
.btn-cta-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    color: var(--ss-accent-dk);
}

.btn-cta-outline {
    background: transparent;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.8rem 2rem;
    border-radius: 2rem;
    border: 2px solid rgba(255,255,255,0.6);
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
}
.btn-cta-outline:hover {
    border-color: #fff;
    background: rgba(255,255,255,0.12);
    color: #fff;
}
