*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #F6F4F0;
    --surface: #FFFFFF;
    --surface-warm: #FAF8F5;
    --text: #1A1A1A;
    --text-muted: #5C5C5C;
    --text-light: #8A8A8A;
    --accent: #2D5A3D;
    --accent-light: #3D7A52;
    --accent-bg: #E8F0EB;
    --border: #E2DED8;
    --border-light: #EDEAE5;

    --color-a: #2D6A4F;
    --color-a-bg: #D8F3DC;
    --color-a-border: #95D5B2;
    --color-b: #B8860B;
    --color-b-bg: #FFF3CD;
    --color-b-border: #FFE082;
    --color-c: #D84315;
    --color-c-bg: #FFE0D0;
    --color-c-border: #FFAB91;
    --color-d: #B71C1C;
    --color-d-bg: #FFCDD2;
    --color-d-border: #EF9A9A;

    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-display: 'Fraunces', Georgia, serif;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 24px rgba(0,0,0,0.08);
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* ---- LOGIN ---- */
.login-screen {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #2D5A3D 0%, #1A3A28 40%, #0F2518 100%);
    transition: opacity 0.5s, visibility 0.5s;
}
.login-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.login-screen::before {
    content: ''; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30h60M30 0v60' stroke='%23ffffff' stroke-width='0.3' opacity='0.08'/%3E%3C/svg%3E");
}

.login-card {
    position: relative;
    background: var(--surface);
    border-radius: 20px;
    padding: 56px 48px;
    max-width: 420px; width: 90%;
    box-shadow: 0 24px 80px rgba(0,0,0,0.3);
    text-align: center;
}

.login-icon {
    width: 64px; height: 64px; margin: 0 auto 24px;
    background: var(--accent-bg);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
}

.login-card h1 {
    font-family: var(--font-display);
    font-size: 1.5rem; font-weight: 600;
    margin-bottom: 8px; color: var(--text);
}
.login-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 32px; }

.login-input {
    width: 100%; padding: 14px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 0.95rem;
    transition: border-color 0.2s;
    outline: none;
}
.login-input:focus { border-color: var(--accent); }

.login-btn {
    width: 100%; margin-top: 16px; padding: 14px;
    background: var(--accent); color: white;
    border: none; border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: background 0.2s;
}
.login-btn:hover { background: var(--accent-light); }

.login-error {
    color: var(--color-d); font-size: 0.85rem;
    margin-top: 12px; display: none;
}

/* ---- LAYOUT ---- */
.app { display: none; }
.app.visible { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 280px; background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 32px 0; overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    padding: 0 28px; margin-bottom: 40px;
    display: flex; align-items: center; gap: 12px;
}
.sidebar-logo-icon {
    width: 40px; height: 40px;
    background: var(--accent); border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 18px; font-weight: 700;
}
.sidebar-logo-text {
    font-family: var(--font-display);
    font-size: 0.95rem; font-weight: 600; color: var(--text);
    line-height: 1.3;
}
.sidebar-logo-text span { display: block; font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-body); font-weight: 400; }

.sidebar-nav { list-style: none; }

.sidebar-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 28px; cursor: pointer;
    transition: all 0.2s; position: relative;
    color: var(--text-muted); font-size: 0.9rem;
}
.sidebar-item:hover { background: var(--surface-warm); color: var(--text); }
.sidebar-item.active {
    background: var(--accent-bg); color: var(--accent);
    font-weight: 600;
}
.sidebar-item.active::before {
    content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
    width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.sidebar-item.completed .step-num { background: var(--accent); color: white; }

.step-num {
    width: 28px; height: 28px; flex-shrink: 0;
    border: 2px solid var(--border);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700;
    transition: all 0.2s;
}
.sidebar-item.active .step-num { border-color: var(--accent); color: var(--accent); }
.sidebar-item.completed .step-num { border-color: var(--accent); }
.sidebar-item.completed .step-num::after { content: '✓'; }
.sidebar-item.completed .step-num span { display: none; }

.main {
    margin-left: 280px; flex: 1;
    padding: 48px 56px 120px;
    max-width: 900px;
}

/* ---- MODULE (hidden by default) ---- */
.module { display: none; }
.module.active { display: block; animation: fadeUp 0.4s ease; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- TYPOGRAPHY ---- */
.module-label {
    font-size: 0.8rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--accent);
    margin-bottom: 8px;
}
.module h2 {
    font-family: var(--font-display);
    font-size: 2rem; font-weight: 700; line-height: 1.25;
    margin-bottom: 12px; color: var(--text);
}
.module-intro {
    font-size: 1.05rem; color: var(--text-muted);
    margin-bottom: 40px; max-width: 640px; line-height: 1.7;
}
.module h3 {
    font-family: var(--font-display);
    font-size: 1.3rem; font-weight: 600;
    margin: 40px 0 16px; color: var(--text);
}
.module h4 {
    font-size: 1rem; font-weight: 600;
    margin: 24px 0 8px;
}

.content p { margin-bottom: 16px; }

/* ---- STORY BLOCK ---- */
.story {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin: 24px 0;
    position: relative;
    font-style: italic; color: var(--text);
    line-height: 1.75;
}
.story::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 4px; background: var(--accent);
    border-radius: var(--radius) 0 0 var(--radius);
}
.story strong { font-style: normal; }

/* ---- ABCD CARDS ---- */
.abcd-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 16px; margin: 24px 0;
}
.abcd-card {
    border-radius: var(--radius);
    padding: 24px;
    border: 1.5px solid;
    transition: transform 0.2s, box-shadow 0.2s;
}
.abcd-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.abcd-card.level-a { background: var(--color-a-bg); border-color: var(--color-a-border); }
.abcd-card.level-b { background: var(--color-b-bg); border-color: var(--color-b-border); }
.abcd-card.level-c { background: var(--color-c-bg); border-color: var(--color-c-border); }
.abcd-card.level-d { background: var(--color-d-bg); border-color: var(--color-d-border); }

.abcd-letter {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px;
    font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
    color: white; margin-bottom: 12px;
}
.level-a .abcd-letter { background: var(--color-a); }
.level-b .abcd-letter { background: var(--color-b); }
.level-c .abcd-letter { background: var(--color-c); }
.level-d .abcd-letter { background: var(--color-d); }

.abcd-card h4 { margin: 0 0 4px; font-size: 0.95rem; }
.abcd-card .abcd-type {
    font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; margin-bottom: 10px;
}
.level-a .abcd-type { color: var(--color-a); }
.level-b .abcd-type { color: var(--color-b); }
.level-c .abcd-type { color: var(--color-c); }
.level-d .abcd-type { color: var(--color-d); }

.abcd-card p { font-size: 0.88rem; color: var(--text-muted); margin: 0 0 10px; }
.abcd-action {
    font-size: 0.85rem; font-weight: 500;
    padding: 8px 12px; border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.7);
}

/* ---- CALLOUT ---- */
.callout {
    background: var(--accent-bg);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin: 24px 0;
    border-left: 4px solid var(--accent);
}
.callout strong { color: var(--accent); }

/* ---- QUIZ ---- */
.quiz-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin: 28px 0;
}
.quiz-block h4 {
    font-size: 0.95rem; margin: 0 0 6px;
    display: flex; align-items: center; gap: 8px;
}
.quiz-block h4 .tag {
    font-size: 0.7rem; background: var(--accent-bg);
    color: var(--accent); padding: 3px 8px;
    border-radius: 4px; font-weight: 600;
}
.quiz-question { margin-bottom: 16px; color: var(--text-muted); font-size: 0.95rem; }

.quiz-options { display: flex; flex-direction: column; gap: 8px; }

.quiz-opt {
    display: block; width: 100%; text-align: left;
    padding: 14px 18px;
    background: var(--surface-warm);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 0.9rem;
    cursor: pointer; transition: all 0.2s;
    color: var(--text);
}
.quiz-opt:hover:not(.answered) { border-color: var(--accent); background: var(--accent-bg); }
.quiz-opt.correct {
    border-color: var(--color-a-border); background: var(--color-a-bg);
    color: var(--color-a); font-weight: 500;
}
.quiz-opt.incorrect {
    border-color: var(--color-d-border); background: var(--color-d-bg);
    color: var(--color-d); opacity: 0.7;
}
.quiz-opt.answered { pointer-events: none; }

.quiz-feedback {
    margin-top: 14px; padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem; display: none;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.positive { background: var(--color-a-bg); color: var(--color-a); border: 1px solid var(--color-a-border); }
.quiz-feedback.negative { background: var(--color-d-bg); color: var(--color-d); border: 1px solid var(--color-d-border); }

/* ---- SCENARIO ---- */
.scenario {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin: 28px 0;
}
.scenario-label {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--accent); margin-bottom: 12px;
}
.scenario p { margin-bottom: 16px; }

.scenario-options {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.scenario-btn {
    padding: 14px 16px; text-align: left;
    background: var(--surface-warm);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 0.88rem;
    cursor: pointer; transition: all 0.2s;
    color: var(--text);
}
.scenario-btn:hover:not(.answered) { border-color: var(--accent); background: var(--accent-bg); }
.scenario-btn.best { border-color: var(--color-a-border); background: var(--color-a-bg); color: var(--color-a); font-weight: 500; }
.scenario-btn.ok { border-color: var(--color-b-border); background: var(--color-b-bg); color: var(--color-b); }
.scenario-btn.wrong { border-color: var(--color-d-border); background: var(--color-d-bg); color: var(--color-d); opacity: 0.7; }
.scenario-btn.answered { pointer-events: none; }

.scenario-feedback {
    margin-top: 14px; padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem; display: none;
    line-height: 1.6;
}
.scenario-feedback.show { display: block; }

/* ---- REFLECTION ---- */
.reflection {
    background: var(--surface-warm);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin: 24px 0;
}
.reflection h4 { font-size: 0.95rem; margin-bottom: 8px; }
.reflection p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 14px; }
.reflection textarea {
    width: 100%; min-height: 80px; padding: 14px 16px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 0.9rem;
    resize: vertical; outline: none;
    transition: border-color 0.2s;
}
.reflection textarea:focus { border-color: var(--accent); }

/* ---- CHECKLIST ---- */
.checklist { margin: 20px 0; }
.check-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.92rem;
}
.check-item:last-child { border-bottom: none; }
.check-box {
    width: 22px; height: 22px; flex-shrink: 0;
    border: 2px solid var(--border);
    border-radius: 6px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; margin-top: 2px;
    font-size: 12px; color: transparent;
}
.check-box.checked {
    background: var(--accent); border-color: var(--accent);
    color: white;
}

/* ---- DRAG AND DROP ---- */
.drag-exercise { margin: 24px 0; }
.drag-instruction { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 16px; }

.drag-zones {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 20px; margin-bottom: 16px;
}
.drag-zone {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 16px;
    min-height: 120px;
    transition: border-color 0.2s, background 0.2s;
}
.drag-zone.over { border-color: var(--accent); background: var(--accent-bg); }
.drag-zone-label {
    font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; margin-bottom: 10px; text-align: center;
}

.drag-items { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; }

.drag-item {
    padding: 10px 16px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem; cursor: grab;
    transition: all 0.2s;
    user-select: none;
}
.drag-item:active { cursor: grabbing; }
.drag-item.placed { opacity: 0.4; pointer-events: none; }

.drag-zone .drag-item {
    margin: 4px;
    background: var(--accent-bg);
    border-color: var(--accent);
    cursor: pointer;
}

/* ---- MODULE NAV ---- */
.module-nav {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 48px; padding-top: 24px;
    border-top: 1px solid var(--border);
}
.nav-btn {
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 0.9rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    border: none;
}
.nav-btn.primary { background: var(--accent); color: white; }
.nav-btn.primary:hover { background: var(--accent-light); }
.nav-btn.secondary { background: var(--surface); border: 1.5px solid var(--border); color: var(--text); }
.nav-btn.secondary:hover { border-color: var(--accent); }
.nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.module-progress-text { font-size: 0.85rem; color: var(--text-light); }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .sidebar { display: none; }
    .main { margin-left: 0; padding: 32px 24px 100px; }
    .abcd-grid { grid-template-columns: 1fr; }
    .scenario-options { grid-template-columns: 1fr; }
    .drag-zones { grid-template-columns: 1fr; }
}

/* ---- VIDEO PLACEHOLDER ---- */
.video-placeholder {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin: 28px 0;
    text-align: center;
}
.video-placeholder .video-icon {
    font-size: 2.5rem; margin-bottom: 12px; opacity: 0.6;
}
.video-placeholder h4 {
    font-size: 1rem; margin: 0 0 6px; color: var(--text);
}
.video-placeholder p {
    font-size: 0.88rem; color: var(--text-muted); margin: 0 0 12px;
}
.video-placeholder .filming-note {
    font-size: 0.78rem; color: var(--text-light);
    background: var(--surface-warm); border-radius: var(--radius-sm);
    padding: 10px 14px; display: inline-block; margin-top: 8px;
    text-align: left; max-width: 520px;
}

/* ---- FINISH ---- */
.finish-screen {
    text-align: center;
    padding: 60px 20px;
}
.finish-icon { font-size: 4rem; margin-bottom: 20px; }
.finish-screen h2 { margin-bottom: 16px; }
.finish-screen p { color: var(--text-muted); max-width: 480px; margin: 0 auto 32px; }
