:root {
    --bg: #f6f8ef;
    --card: rgba(255, 255, 255, 0.92);
    --card-strong: #ffffff;
    --ink: #203022;
    --muted: #657567;
    --accent: #e96f2e;
    --accent-dark: #c54d0f;
    --accent-soft: #ffe1cf;
    --line: rgba(32, 48, 34, 0.12);
    --shadow: 0 20px 50px rgba(32, 48, 34, 0.12);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Nunito", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(233, 111, 46, 0.22), transparent 28%),
        radial-gradient(circle at bottom right, rgba(95, 159, 116, 0.22), transparent 24%),
        linear-gradient(160deg, #fdfcf7 0%, var(--bg) 100%);
}

button,
input,
select {
    font: inherit;
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr);
    gap: 24px;
    align-items: stretch;
    margin-bottom: 28px;
}

.eyebrow {
    display: inline-flex;
    margin: 0 0 12px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--accent-dark);
    font-weight: 700;
}

h1,
h2 {
    font-family: "Baloo 2", cursive;
    line-height: 1;
    margin: 0;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4.7rem);
    margin-bottom: 16px;
}

h2 {
    font-size: 2rem;
    margin-bottom: 14px;
}

.hero-copy,
.section-head p,
.hint,
.empty-state {
    color: var(--muted);
}

.hero-card,
.panel {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.64);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.hero-card {
    display: grid;
    gap: 10px;
    padding: 28px;
    align-content: center;
    background:
        linear-gradient(160deg, rgba(233, 111, 46, 0.16), rgba(255, 255, 255, 0.96)),
        var(--card);
}

.hero-card span {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    color: var(--accent-dark);
    font-weight: 800;
}

.hero-card strong {
    font-size: 1.18rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.panel {
    padding: 24px;
}

.panel-wide {
    grid-column: 1 / -1;
}

.stack {
    display: grid;
    gap: 14px;
}

label span,
.direction-switch span {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    background: var(--card-strong);
    color: var(--ink);
}

button {
    border: 0;
    border-radius: 16px;
    padding: 14px 18px;
    background: var(--accent);
    color: white;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

button:hover {
    transform: translateY(-1px);
    background: var(--accent-dark);
}

button.secondary {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

button.danger {
    margin-top: 10px;
    background: #9c2d00;
}

button.danger:hover {
    background: #742200;
}

.upload-box {
    padding: 16px;
    border-radius: 20px;
    border: 2px dashed rgba(233, 111, 46, 0.35);
    background: rgba(255, 255, 255, 0.65);
}

.upload-box small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.status-box,
.empty-state {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--line);
}

.system-check-status {
    display: grid;
    gap: 14px;
}

.upload-progress {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    font-weight: 700;
}

.start-screen {
    min-height: min(680px, calc(100vh - 48px));
    padding: clamp(32px, 7vw, 82px);
    display: grid;
    align-content: center;
    gap: 18px;
    border-radius: 32px;
    background:
        radial-gradient(circle at 85% 18%, rgba(247, 178, 87, 0.45), transparent 27%),
        linear-gradient(135deg, #fff4ea, #eef5df);
    border: 1px solid rgba(233, 111, 46, 0.2);
}

.start-screen h1 {
    margin: 0;
    font-size: clamp(3rem, 8vw, 6.3rem);
    line-height: 0.9;
}

.start-screen > p:not(.eyebrow) {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-size: 1.15rem;
}

.learning-path {
    display: grid;
    grid-template-columns: minmax(240px, 380px) minmax(220px, 320px);
    gap: 18px;
    align-items: center;
    margin-top: 20px;
}

.subject-card,
.trainer-choice {
    min-height: 190px;
    padding: 24px;
    text-align: left;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink);
}

.subject-card span,
.trainer-choice > span,
.subject-card small {
    display: block;
}

.subject-card strong {
    display: block;
    margin: 8px 0;
    font-size: 2rem;
}

.subject-card small {
    color: var(--muted);
    font-weight: 600;
}

.subject-card.selected {
    outline: 4px solid rgba(247, 178, 87, 0.55);
}

.trainer-choice {
    border-radius: 20px;
}

.trainer-choice button {
    width: 100%;
    margin-top: 18px;
}

.app-nav {
    display: flex;
    gap: 10px;
    margin: -8px 0 24px;
}

.app-nav button.active {
    background: var(--accent);
    color: #fff;
}

.progress-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #eadfce;
}

.progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #f7b257);
    transition: width 0.25s ease;
}

.progress-track.is-processing .progress-bar {
    animation: ai-reading 1.3s ease-in-out infinite;
}

@keyframes ai-reading {
    50% {
        filter: brightness(1.18);
        transform: scaleX(1.08);
        transform-origin: left;
    }
}

.requirements-panel {
    margin-top: 28px;
    padding: 28px;
    border-radius: 28px;
    background: linear-gradient(135deg, #fff4ea, #f7f1d4);
    border: 1px solid rgba(233, 111, 46, 0.24);
}

.requirements-panel h2 {
    margin: 4px 0 8px;
}

.requirements-panel > p {
    margin: 0 0 20px;
    color: var(--muted);
}

.check-group {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.check-group > strong {
    display: inline-block;
    margin-right: 8px;
}

.check-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check-group p,
.check-group ul {
    margin: 9px 0 0;
}

.check-group ul {
    padding-left: 18px;
}

.check-group li {
    margin: 8px 0;
    display: flex;
    align-items: start;
    gap: 9px;
}

.check-group li small {
    display: block;
    color: var(--muted);
}

.check-ok,
.check-missing {
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    min-width: 22px;
    min-height: 22px;
    font-size: 0.78rem;
    font-weight: 800;
}

.check-icon {
    flex: 0 0 auto;
}

.check-ok {
    background: #daf0d8;
    color: #216b2a;
}

.check-missing {
    background: #ffe2d6;
    color: #9c2d00;
}

.check-error small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 18px;
}

.section-head p {
    margin: 6px 0 0;
}

.training-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.training-card {
    padding: 18px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--line);
}

.training-card h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
}

.training-card p {
    margin: 4px 0;
    color: var(--muted);
}

.training-card button {
    width: 100%;
    margin-top: 14px;
}

.quiz-card {
    display: grid;
    gap: 16px;
    padding: 22px;
    border-radius: 24px;
    background: linear-gradient(180deg, #fff4ea, #ffffff);
    border: 1px solid rgba(233, 111, 46, 0.2);
}

.quiz-meta,
.score-row,
.quiz-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.quiz-question {
    min-height: 110px;
    padding: 24px;
    border-radius: 20px;
    background: #fff;
    font-size: clamp(1.5rem, 2.6vw, 2.2rem);
    font-weight: 800;
    display: grid;
    place-items: center;
    text-align: center;
}

.quiz-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.quiz-feedback {
    min-height: 28px;
    font-weight: 700;
}

.hidden {
    display: none;
}

@media (max-width: 900px) {
    .hero,
    .grid {
        grid-template-columns: 1fr;
    }

    .section-head,
    .quiz-meta,
    .score-row,
    .quiz-actions,
    .quiz-form {
        display: grid;
    }

    .learning-path {
        grid-template-columns: 1fr;
    }
}
