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

body {
  font-family: Georgia, serif;
  background: #f5f5f0;
  color: #1a1a1a;
  line-height: 1.7;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 40px 20px;
}

.screen.active {
  display: block;
}

.container {
  max-width: 720px;
  margin: 0 auto;
}

h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 12px;
}

h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 20px;
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.subtitle {
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 24px;
}

.btn-primary {
  background: #1a3a5c;
  color: white;
  border: none;
  padding: 14px 32px;
  font-size: 1rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 24px;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #0f2540;
}

/* ── AUTH ────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-bottom: 2px solid #d0d0d0;
}

.auth-tab {
  background: transparent;
  border: none;
  padding: 10px 24px;
  font-size: 1rem;
  font-family: Georgia, serif;
  color: #777;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.auth-tab:hover {
  color: #1a3a5c;
}

.auth-tab.active {
  color: #1a3a5c;
  font-weight: 700;
  border-bottom: 3px solid #1a3a5c;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
}

.auth-input {
  padding: 12px 16px;
  font-size: 1rem;
  font-family: Georgia, serif;
  border: 1.5px solid #d0d0d0;
  border-radius: 4px;
  background: white;
  color: #1a1a1a;
  transition: border-color 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: #1a3a5c;
}

.auth-error {
  color: #c62828;
  font-size: 0.9rem;
  min-height: 1.2em;
}

.auth-success {
  color: #2e7d32;
  font-size: 0.9rem;
  min-height: 1.2em;
}

/* ── WELCOME ─────────────────────────────────────────── */
.welcome-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.welcome-header h1 {
  margin-bottom: 0;
}

.btn-signout {
  background: transparent;
  border: 1.5px solid #a0a0a0;
  color: #666;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-signout:hover {
  border-color: #1a3a5c;
  color: #1a3a5c;
}

.welcome-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  color: #444;
}

.info-item span {
  font-size: 1.2rem;
  width: 28px;
}

/* ── TEST LAYOUT ─────────────────────────────────────── */
#screen-test {
  padding: 0;
}

.test-layout {
  display: flex;
  min-height: 100vh;
}

.side-panel {
  width: 200px;
  min-width: 200px;
  background: #1a3a5c;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.module-label {
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  padding: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  font-family: Georgia, serif;
}

.timer-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px 14px;
  text-align: center;
}

.timer-label {
  color: #a0b8d0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.timer-display {
  color: white;
  font-size: 1.6rem;
  font-weight: 700;
  font-family: Georgia, serif;
  letter-spacing: 0.05em;
}

.side-panel-title {
  color: #a0b8d0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.q-num-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.q-num-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #a0b8d0;
  background: transparent;
  color: #a0b8d0;
  font-family: Georgia, serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.q-num-btn:hover {
  border-color: white;
  color: white;
}

.q-num-btn.current {
  border-color: white;
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

.q-num-btn.answered {
  border-color: #5bc8a0;
  color: #5bc8a0;
}

.q-num-btn.current.answered {
  background: rgba(91, 200, 160, 0.2);
}

.q-flag {
  position: absolute;
  top: -6px;
  right: -4px;
  font-size: 11px;
  color: #f5a623;
  pointer-events: none;
}

.side-panel-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #a0b8d0;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #5bc8a0;
  display: inline-block;
}

.legend-flag {
  font-size: 11px;
  color: #f5a623;
}

.btn-submit {
  margin-top: auto;
  background: #c9902a;
  color: white;
  border: none;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-submit:hover {
  background: #a8751f;
}

.test-main {
  flex: 1;
  padding: 40px;
  max-width: 760px;
}

.question-counter {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 16px;
}

.question-text {
  font-size: 1.15rem;
  line-height: 1.8;
  margin-bottom: 28px;
  background: white;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.answer-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-btn {
  background: white;
  border: 1.5px solid #d0d0d0;
  padding: 14px 20px;
  font-size: 1rem;
  font-family: Georgia, serif;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.choice-btn:hover {
  border-color: #1a3a5c;
  background: #f0f4f8;
}

.choice-btn.selected {
  border-color: #1a3a5c;
  background: #e8f0f8;
  color: #1a3a5c;
}

.choice-btn.correct {
  border-color: #2e7d32;
  background: #e8f5e9;
  color: #1b5e20;
}

.choice-btn.incorrect {
  border-color: #c62828;
  background: #ffebee;
  color: #b71c1c;
}

.choice-btn.reveal {
  border-color: #2e7d32;
  background: #e8f5e9;
  color: #1b5e20;
}

.test-actions {
  margin-top: 20px;
}

.btn-mark {
  background: transparent;
  border: 1.5px solid #a0a0a0;
  color: #666;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-mark:hover {
  border-color: #f5a623;
  color: #c9902a;
}

.btn-mark.marked {
  border-color: #f5a623;
  color: #c9902a;
  background: #fff8ee;
}

.test-nav {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn-nav {
  background: white;
  border: 1.5px solid #1a3a5c;
  color: #1a3a5c;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-nav:hover {
  background: #1a3a5c;
  color: white;
}

/* ── CONFIRMATION ────────────────────────────────────── */
#screen-confirm {
  display: none;
  align-items: center;
  justify-content: center;
}

#screen-confirm.active {
  display: flex;
}

.confirm-container {
  background: white;
  border-radius: 12px;
  padding: 48px;
  max-width: 480px;
  width: 100%;
  border: 1px solid #e0e0e0;
  text-align: center;
}

.confirm-text {
  font-size: 1.1rem;
  color: #444;
  margin-bottom: 28px;
  line-height: 1.6;
}

.confirm-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
  text-align: left;
}

.confirm-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  color: #444;
  padding: 10px 16px;
  background: #f5f5f0;
  border-radius: 6px;
}

.confirm-stat span {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a3a5c;
  min-width: 32px;
}

.confirm-stat.warn span {
  color: #c62828;
}

.confirm-stat.flag span {
  color: #c9902a;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-back-confirm {
  background: white;
  border: 1.5px solid #1a3a5c;
  color: #1a3a5c;
  padding: 12px 24px;
  font-size: 1rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back-confirm:hover {
  background: #f0f4f8;
}

.btn-confirm-submit {
  background: #c9902a;
  color: white;
  border: none;
  padding: 12px 28px;
  font-size: 1rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-confirm-submit:hover {
  background: #a8751f;
}

/* ── BREAK SCREEN ────────────────────────────────────── */
#screen-break {
  display: none;
  align-items: center;
  justify-content: center;
}

#screen-break.active {
  display: flex;
}

.break-container {
  background: white;
  border-radius: 12px;
  padding: 48px;
  max-width: 480px;
  width: 100%;
  border: 1px solid #e0e0e0;
  text-align: center;
}

.break-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.break-text {
  font-size: 1.1rem;
  color: #444;
  margin-bottom: 32px;
  line-height: 1.6;
}

.break-timer-box {
  background: #1a3a5c;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.break-timer-label {
  color: #a0b8d0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.break-timer-display {
  color: white;
  font-size: 3rem;
  font-weight: 700;
  font-family: Georgia, serif;
  letter-spacing: 0.05em;
}

.break-note {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 8px;
}

/* ── RESULTS ─────────────────────────────────────────── */
.score-summary {
  background: white;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 28px;
  border: 1px solid #e0e0e0;
  font-size: 1.1rem;
}

.score-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a3a5c;
  margin-bottom: 8px;
}

.module-scores {
  font-size: 0.9rem;
  color: #777;
  margin-top: 8px;
}

.score-message {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  font-size: 1rem;
  line-height: 1.8;
  color: #444;
  text-align: left;
}

.results-message {
  background: white;
  border-radius: 8px;
  padding: 28px;
  border: 1px solid #e0e0e0;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 1.05rem;
  line-height: 1.8;
  color: #444;
}

.results-watch-inbox {
  font-size: 1.1rem;
  color: #1a3a5c;
}

.results-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-secondary {
  background: white;
  border: 1.5px solid #1a3a5c;
  color: #1a3a5c;
  padding: 14px 32px;
  font-size: 1rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 24px;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #f0f4f8;
}

/* ── TUTORIAL ────────────────────────────────────────── */
.tutorial-progress {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 16px;
}

.tutorial-title {
  font-size: 1.4rem;
  color: #1a3a5c;
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 2px solid #1a3a5c;
}

.tutorial-section {
  margin-bottom: 28px;
}

.content-box {
  background: white;
  border-radius: 8px;
  padding: 24px;
  border: 1px solid #e0e0e0;
  font-size: 1.05rem;
  line-height: 1.8;
}

.tutorial-video-container {
  margin-bottom: 28px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.tutorial-video {
  width: 100%;
  height: 360px;
  border: none;
}

/* ── PRACTICE ────────────────────────────────────────── */
.difficulty-badge-container {
  margin-bottom: 16px;
}

.difficulty-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.difficulty-badge.easy {
  background: #e8f5e9;
  color: #2e7d32;
}

.difficulty-badge.medium {
  background: #fff3e0;
  color: #e65100;
}

.difficulty-badge.hard {
  background: #ffebee;
  color: #c62828;
}

.feedback-box {
  margin-top: 20px;
  padding: 20px 24px;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1.7;
}

.feedback-box.correct {
  background: #e8f5e9;
  border-left: 4px solid #2e7d32;
  color: #1b5e20;
}

.feedback-box.incorrect {
  background: #ffebee;
  border-left: 4px solid #c62828;
  color: #7f0000;
}

.loading {
  text-align: center;
  padding: 60px 20px;
  color: #777;
  font-size: 1.1rem;
}

/* ── VISUAL QUESTION CONTAINER ───────────────────────── */
.visual-container {
  margin-bottom: 16px;
  text-align: center;
}

.visual-container svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.question-body-text {
  font-size: 1.15rem;
  line-height: 1.8;
  margin-top: 4px;
}

#practice-question .visual-container {
  margin-bottom: 14px;
}