/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0c;
  --surface: #141418;
  --surface-2: #1c1c22;
  --surface-3: #24242c;
  --border: #2a2a35;
  --text: #e8e6e3;
  --text-dim: #8a8a96;
  --text-muted: #5a5a66;
  --accent: #c4a882;
  --accent-dim: #a08a6a;
  --accent-glow: rgba(196, 168, 130, 0.15);
  --success: #6ecf8e;
  --warning: #e8c468;
  --danger: #e87272;
  --compare: #82b4c4;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, sans-serif;
}

html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== SCREENS ===== */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; }

/* ===== LANDING ===== */
#screen-landing {
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(196,168,130,0.06) 0%, transparent 60%);
}

.landing-container {
  text-align: center;
  max-width: 680px;
  padding: 40px 24px;
}

.logo-mark {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 6px;
  color: var(--accent);
  margin-bottom: 32px;
  text-transform: uppercase;
}
.logo-mark.small {
  font-size: 11px;
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.landing-container h1 {
  font-size: 3.2rem;
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 56px;
}

.landing-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 48px;
  text-align: left;
}

.feature {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feature-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  min-width: 24px;
}

.feature-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dim);
}
.feature-text strong {
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 14px 40px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.btn-primary:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 12px;
}
.btn-secondary:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 24px;
  display: inline-block;
}
.btn-back:hover { color: var(--text); }

/* ===== FORMS ===== */
.form-container {
  max-width: 520px;
  margin: 0 auto;
  padding: 80px 24px;
}

.form-container h2 {
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 8px;
}

.form-desc {
  color: var(--text-dim);
  margin-bottom: 40px;
  font-size: 15px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.optional {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-weight: 400;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  transition: border-color 0.2s;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

/* Mode toggle */
.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  color: var(--text-dim);
}
.mode-btn strong {
  display: block;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 6px;
}
.mode-btn span {
  font-size: 12px;
  line-height: 1.5;
}
.mode-btn.active {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.mode-btn.active strong { color: var(--accent); }
.mode-btn:hover { border-color: var(--accent-dim); }

/* ===== ASSESSMENT ===== */
.assessment-layout {
  display: flex;
  width: 100%;
  height: 100vh;
}

.assessment-sidebar {
  width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

#stage-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

#stage-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.progress-bar {
  height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
  margin-bottom: 32px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.zone-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.zone-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-dim);
  transition: all 0.2s;
}
.zone-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 500;
}
.zone-item.done { color: var(--text-muted); }

.zone-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-3);
  flex-shrink: 0;
}
.zone-item.active .zone-dot { background: var(--accent); }
.zone-item.done .zone-dot { background: var(--success); }

.zone-score {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.zone-item.done .zone-score { color: var(--text-dim); }

.assessment-meta {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
}

.meta-name { font-size: 13px; color: var(--text-dim); }
.meta-time { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* MAIN AREA */
.assessment-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.camera-container {
  flex: 1;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#camera-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

#face-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  transform: scaleX(-1);
  pointer-events: none;
}

.zone-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.zone-visual-label {
  font-size: 4rem;
  font-weight: 200;
  color: var(--accent);
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: 0.3;
}

.btn-enable-camera {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-enable-camera:hover { border-color: var(--text-dim); color: var(--text-dim); }

/* TASK PANEL */
.task-panel {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 28px 32px;
}

.task-zone {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 600;
}

.task-instruction {
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 8px;
  max-width: 700px;
}

.task-cue {
  font-size: 14px;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 20px;
  min-height: 20px;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.score-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-right: 4px;
}

.score-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}
.score-btn:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent);
  transform: translateY(-2px);
}

.score-hints {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: var(--text-muted);
  gap: 2px;
}

.task-teacher-note {
  margin-top: 16px;
}

.task-teacher-note textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-dim);
  resize: vertical;
}
.task-teacher-note textarea:focus {
  outline: none;
  border-color: var(--accent);
  color: var(--text);
}
.task-teacher-note textarea::placeholder { color: var(--text-muted); }

/* ===== REPORT ===== */
.report-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 48px;
  flex-wrap: wrap;
  gap: 20px;
}

.report-header h2 {
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 8px;
}

.report-name {
  font-size: 15px;
  color: var(--accent);
  font-weight: 500;
}

.report-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.report-mode {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.report-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.report-actions .btn-secondary { margin-left: 0; }

/* Comparison */
.comparison-banner {
  background: var(--surface);
  border: 2px solid var(--compare);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
}

.comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.comparison-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--compare);
}

.comparison-header .btn-back {
  margin-bottom: 0;
  font-size: 18px;
  color: var(--text-muted);
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.comparison-stat {
  text-align: center;
}

.comparison-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.comparison-stat-value {
  font-size: 1.8rem;
  font-weight: 300;
}

.comparison-stat-value.positive { color: var(--success); }
.comparison-stat-value.negative { color: var(--danger); }
.comparison-stat-value.neutral { color: var(--text-dim); }

.comparison-zones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.comparison-zone {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}

.comparison-zone-name {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.comparison-zone-change {
  font-size: 1.2rem;
  font-weight: 600;
}

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.report-card.full-width { margin-bottom: 20px; }

.report-card h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 20px;
  font-weight: 600;
}

.chart-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#radar-chart { max-width: 360px; max-height: 360px; }

/* Summary card */
.summary-card .summary-score {
  font-size: 3.5rem;
  font-weight: 300;
  color: var(--accent);
  margin-bottom: 4px;
}
.summary-card .summary-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.summary-stat {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.summary-stat:last-child { border-bottom: none; }
.summary-stat-label { color: var(--text-dim); }
.summary-stat-value { font-weight: 600; }
.summary-stat-value.strength { color: var(--success); }
.summary-stat-value.weakness { color: var(--danger); }

/* Zone breakdown */
.zone-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.zone-card {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.zone-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.zone-card-name { font-size: 15px; font-weight: 600; }
.zone-card-score { font-size: 20px; font-weight: 300; color: var(--accent); }

.stage-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}

.stage-bar-label { width: 80px; color: var(--text-dim); flex-shrink: 0; }
.stage-bar-track {
  flex: 1;
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
}
.stage-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.stage-bar-value { width: 20px; text-align: right; color: var(--text-muted); font-weight: 600; }

/* Key findings */
.finding {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.finding:last-child { border-bottom: none; }
.finding-icon {
  font-size: 20px;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.finding-text h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.finding-text p { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

/* ===== CURRICULUM ===== */
.curriculum-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.week-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.week-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}

.week-number {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 600;
}

.week-focus { font-size: 13px; color: var(--text-dim); }

.week-title {
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 20px;
}

.drill-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drill {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  position: relative;
}

.drill-time {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  min-width: 50px;
  flex-shrink: 0;
}

.drill-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.drill-desc { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

.week-note {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--accent-glow);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--accent);
  line-height: 1.5;
}

/* ===== HISTORY ===== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s;
}
.history-item:hover { border-color: var(--accent); }
.history-item-name { font-weight: 500; }
.history-item-date { font-size: 13px; color: var(--text-muted); }
.history-item-score { font-size: 20px; font-weight: 300; color: var(--accent); }
.history-item-mode { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.history-item-actions { display: flex; gap: 8px; align-items: center; }

.history-compare-btn {
  background: transparent;
  border: 1px solid var(--compare);
  color: var(--compare);
  font-size: 11px;
  font-family: var(--font);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.history-compare-btn:hover {
  background: rgba(130, 180, 196, 0.1);
}

.history-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.history-section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 24px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ===== STUDENT VIEW ===== */
.student-view {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 24px;
  width: 100%;
}

.student-header {
  text-align: center;
  margin-bottom: 40px;
}

.student-header h2 {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 8px;
}

.student-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
}

.student-summary .score-big {
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--accent);
}

.student-summary .score-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.student-summary .focus-text {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

.student-daily {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.student-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.student-day-header {
  background: var(--accent-glow);
  padding: 14px 20px;
  font-weight: 600;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.student-day-header .day-time {
  font-weight: 400;
  font-size: 12px;
  color: var(--accent-dim);
}

.student-day-drills {
  padding: 16px 20px;
}

.student-drill {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.student-drill:last-child { border-bottom: none; }

.student-drill-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}
.student-drill-time {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}
.student-drill-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.student-footer {
  text-align: center;
  margin-top: 40px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface-2);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font);
  z-index: 1000;
  transition: transform 0.3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== PRINT ===== */
@media print {
  body { background: #fff; color: #111; }
  .btn-primary, .btn-secondary, .btn-back, .report-actions { display: none !important; }
  .report-card { border: 1px solid #ddd; break-inside: avoid; }
  .screen { display: block !important; min-height: auto; }
  #screen-landing, #screen-intake, #screen-assessment, #screen-history { display: none !important; }
  .comparison-banner { border-color: #999; }
  .comparison-header .btn-back { display: none; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .landing-features { grid-template-columns: 1fr; }
  .landing-container h1 { font-size: 2.2rem; }
  .assessment-layout { flex-direction: column; }
  .assessment-sidebar { width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; padding: 16px; }
  .zone-list { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .report-grid { grid-template-columns: 1fr; }
  .zone-breakdown { grid-template-columns: 1fr; }
  .report-header { flex-direction: column; }
  .comparison-grid { grid-template-columns: 1fr; }
  .comparison-zones { grid-template-columns: 1fr 1fr; }
  .mode-toggle { grid-template-columns: 1fr; }
}
