:root {
    --bg: #0f172a;
    --bg-soft: #1e293b;
    --card: #ffffff;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --accent: #06b6d4;
    --success: #16a34a;
    --danger: #dc2626;
    --muted: #64748b;
    --border: #e2e8f0;
    --text: #0f172a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    background: #f1f5f9;
    color: var(--text);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Navbar */
.navbar {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    color: #fff;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.navbar .brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar .brand:hover {
    text-decoration: none;
}

.brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 8px;
    background: #ffffff;
    padding: 2px;
}

.brand-text {
    letter-spacing: 0.01em;
}

.navbar .nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.navbar .nav-links a,
.navbar .nav-links span {
    color: #fff;
    font-weight: 500;
}

.navbar form {
    margin: 0;
}

.btn-link-plain {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-link-plain:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Layout */
.container {
    max-width: 1000px;
    margin: 32px auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 460px;
}

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.topic-card {
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.topic-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.15);
    text-decoration: none;
}

.topic-card h3 {
    margin: 0 0 8px;
    color: var(--primary-dark);
}

.topic-card p {
    color: var(--muted);
    flex-grow: 1;
    margin: 0 0 14px;
}

.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: var(--primary-dark);
}

.badge-gre { background: #ecfeff; color: #0e7490; }
.badge-cat { background: #fef3c7; color: #b45309; }
.badge-both { background: #eef2ff; color: var(--primary-dark); }
.badge-class6 { background: #dcfce7; color: #166534; }

/* Stats */
.stats {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 22px;
    flex: 1;
    min-width: 160px;
}

.stat .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat .label {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.btn-block {
    width: 100%;
}

.btn-success { background: var(--success); }
.btn-success:hover { background: #15803d; }

.btn-outline {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: #eef2ff;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.alert-error { background: #fee2e2; color: var(--danger); }
.alert-success { background: #dcfce7; color: var(--success); }
.alert-info { background: #e0f2fe; color: #0369a1; }

.field-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Lessons */
.lesson {
    margin-bottom: 28px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}

.lesson h3 {
    color: var(--primary-dark);
}

.lesson table {
    border-collapse: collapse;
    margin: 12px 0;
}

.lesson th, .lesson td {
    border: 1px solid var(--border);
    padding: 6px 12px;
}

.formula {
    background: #f8fafc;
    border-left: 4px solid var(--accent);
    padding: 10px 14px;
    margin: 12px 0;
    border-radius: 4px;
    font-family: "Cascadia Code", Consolas, monospace;
}

/* Lesson callout boxes */
.callout {
    border-radius: 10px;
    padding: 14px 16px 14px 18px;
    margin: 16px 0;
    border-left: 5px solid var(--muted);
    background: #f8fafc;
}

.callout .callout-title {
    display: block;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.callout p:last-child { margin-bottom: 0; }

.c-analogy { background: #f5f3ff; border-left-color: #8b5cf6; }
.c-analogy .callout-title { color: #6d28d9; }

.c-example { background: #eff6ff; border-left-color: #3b82f6; }
.c-example .callout-title { color: #1d4ed8; }

.c-tip { background: #f0fdf4; border-left-color: #22c55e; }
.c-tip .callout-title { color: #15803d; }

.c-warn { background: #fff7ed; border-left-color: #f97316; }
.c-warn .callout-title { color: #c2410c; }

.c-recap { background: #ecfeff; border-left-color: #06b6d4; }
.c-recap .callout-title { color: #0e7490; }

.c-key { background: #eef2ff; border-left-color: var(--primary); }
.c-key .callout-title { color: var(--primary-dark); }

.c-ref { background: #fdf4ff; border-left-color: #c026d3; }
.c-ref .callout-title { color: #a21caf; }

/* Step-by-step lists inside lessons */
.lesson ol.steps {
    counter-reset: step;
    list-style: none;
    padding-left: 0;
    margin: 12px 0;
}

.lesson ol.steps > li {
    position: relative;
    padding: 6px 0 6px 40px;
    margin-bottom: 6px;
}

.lesson ol.steps > li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 6px;
    width: 26px;
    height: 26px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 26px;
    font-weight: 700;
    font-size: 0.85rem;
}

.lesson h4 {
    color: var(--primary-dark);
    margin: 18px 0 6px;
    font-size: 1.08rem;
}

.lesson .qa {
    font-style: italic;
    color: var(--muted);
}

.lesson .big-num {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark);
}

/* Practice questions */
.question {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 18px;
}

.question .q-text {
    font-weight: 600;
    margin-bottom: 12px;
}

.option {
    display: block;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.12s ease;
}

.option:hover {
    background: #f8fafc;
}

.option input {
    margin-right: 10px;
}

.option.correct {
    border-color: var(--success);
    background: #f0fdf4;
}

.option.incorrect {
    border-color: var(--danger);
    background: #fef2f2;
}

.tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

.tag-correct { background: #dcfce7; color: var(--success); }
.tag-wrong { background: #fee2e2; color: var(--danger); }

.explanation {
    margin-top: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    font-size: 0.95rem;
}

/* Attempted practice-sheet cards */
.topic-card {
    position: relative;
}

.sheet-done {
    border-color: var(--success);
    background: #f0fdf4;
    box-shadow: 0 0 0 1px var(--success) inset;
}

.sheet-done:hover {
    background: #e7fbee;
}

.done-check {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sheet-score {
    margin: 8px 0 0;
    font-weight: 700;
    color: var(--success);
}

.hint-wrap {
    margin-top: 12px;
}

.hint-btn {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.hint-btn:hover {
    background: #eef2ff;
}

.hint {
    margin-top: 10px;
    padding: 10px 14px;
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.score-banner {
    text-align: center;
    padding: 28px;
    border-radius: 12px;
    color: #fff;
    margin-bottom: 24px;
}

.score-banner h2 {
    margin: 0;
    font-size: 2.4rem;
}

.score-pass { background: linear-gradient(90deg, #16a34a, #22c55e); }
.score-fail { background: linear-gradient(90deg, #ea580c, #f97316); }

.muted {
    color: var(--muted);
}

.page-header {
    margin-bottom: 22px;
}

.page-header h1 {
    margin: 0 0 4px;
}

.timer-card {
    margin-bottom: 18px;
    position: sticky;
    top: 12px;
    z-index: 5;
}

.timer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.timer-clock {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.timer-bar-wrap {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    margin-top: 10px;
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--success), #22c55e);
    transition: width 1s linear;
}

.timer-warning .timer-clock {
    color: var(--danger);
}

.timer-warning .timer-bar {
    background: linear-gradient(90deg, #f59e0b, var(--danger));
}

.prob-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.prob-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.prob-gre {
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

.prob-cat {
    background: linear-gradient(90deg, #8b5cf6, #4f46e5);
}

.hero {
    text-align: center;
    padding: 60px 20px;
}

.hero-letuslearn {
    background: linear-gradient(120deg, #312e81 0%, #4338ca 45%, #0891b2 100%);
    color: #ffffff;
    border-radius: 18px;
    margin: 26px auto 0;
    max-width: 1050px;
    box-shadow: 0 16px 34px rgba(49, 46, 129, 0.28);
}

.hero-badge {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero h1 {
    font-size: 2.6rem;
    margin-bottom: 12px;
}

.hero p {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 640px;
    margin: 0 auto 28px;
}

.hero-letuslearn h1 {
    color: #ffffff;
}

.hero-letuslearn .hero-subtitle {
    color: rgba(255, 255, 255, 0.92);
    max-width: 760px;
}

.hero-letuslearn .hero-subtitle strong {
    color: #ffffff;
}

.hero-letuslearn .btn {
    background: #ffffff;
    color: #312e81;
}

.hero-letuslearn .btn:hover {
    background: #e0e7ff;
    color: #312e81;
}

.hero-letuslearn .btn-outline {
    border-color: rgba(255, 255, 255, 0.85);
    color: #ffffff;
    background: transparent;
}

.hero-letuslearn .btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
}

.track-switch {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-track-switch {
    margin-top: 16px;
    justify-content: center;
}

.track-tab {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.9rem;
}

.track-tab:hover {
    background: #eef2ff;
    text-decoration: none;
}

.track-tab.active {
    background: var(--primary-dark);
    color: #ffffff;
    border-color: var(--primary-dark);
}

/* Standards-style Class 6 page */
.standards-page {
    max-width: 1120px;
}

.standards-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.year-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.year-chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    font-size: 0.85rem;
    color: #334155;
}

.year-chip.active {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
    font-weight: 700;
}

.alignments select {
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #334155;
    background: #f8fafc;
}

.strand-block {
    margin-bottom: 18px;
}

.strand-head h2 {
    margin: 0;
}

.strand-head p {
    margin: 4px 0 0;
}

.skills-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.skill-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: #fff;
    display: block;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.skill-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(2, 132, 199, 0.12);
    text-decoration: none;
}

.skill-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.skill-code {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #0f766e;
    background: #ccfbf1;
    padding: 4px 8px;
    border-radius: 999px;
}

.skill-level {
    font-size: 0.75rem;
    color: #64748b;
}

.skill-card h3 {
    margin: 10px 0 6px;
    font-size: 1.04rem;
    color: var(--primary-dark);
}

.skill-card p {
    margin: 0 0 8px;
    color: #475569;
    font-size: 0.92rem;
}

.skill-pattern {
    display: inline-block;
    margin: 2px 0 8px;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px dashed #94a3b8;
    background: #f8fafc;
    color: #334155;
    font-size: 0.8rem;
    font-family: Consolas, "Courier New", monospace;
}

.skill-cta {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--primary-dark);
}

/* Murder mystery quiz */
.mystery-page {
    max-width: 1080px;
}

.mystery-story h2 {
    margin-top: 0;
}

.clue-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}

.clue-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    padding: 10px 12px;
    color: #334155;
    font-size: 0.92rem;
}

.mystery-quiz {
    margin-top: 16px;
}

.mystery-question {
    margin-bottom: 12px;
}

.mystery-question h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1rem;
}

.mystery-question label {
    display: block;
    margin: 7px 0;
    font-weight: 500;
}

.mystery-question input[type="radio"] {
    margin-right: 8px;
}

.mystery-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0 14px;
}

.mystery-result h3 {
    margin-top: 0;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

table.history {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

table.history th, table.history td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

table.history th {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
