/* ===============================
   CLIMB ORAL EXAM PREP — BETA STYLES
   =============================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --blue:       #1a56db;
  --blue-light: #e8f0fe;
  --green:      #0e7c4a;
  --green-bg:   #e6f4ed;
  --red:        #c0392b;
  --red-bg:     #fdecea;
  --amber:      #d97706;
  --amber-bg:   #fffbeb;
  --gray-100:   #f4f6f9;
  --gray-200:   #e2e8f0;
  --gray-400:   #94a3b8;
  --gray-700:   #334155;
  --gray-900:   #0f172a;
  --radius:     8px;
  --shadow:     0 1px 4px rgba(0,0,0,0.08);
  --max-width:  720px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

/* --- Screens --- */
.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ===============================
   WELCOME SCREEN
   =============================== */

.welcome-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.welcome-logo {
  margin-top: 16px;
}

.welcome-logo img {
  height: 80px;
  width: auto;
}

.welcome-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  text-align: center;
  line-height: 1.2;
}

.welcome-subtitle {
  font-size: 1.05rem;
  color: var(--gray-400);
  text-align: center;
  margin-top: -10px;
}

/* --- Beta banner --- */
.beta-banner {
  width: 100%;
  background: #fff8e1;
  border: 2px solid #f59e0b;
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.beta-badge {
  background: #f59e0b;
  color: white;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.beta-text {
  font-size: 0.95rem;
  color: #7a5800;
  line-height: 1.5;
}

/* --- Welcome instructions --- */
.welcome-instructions {
  width: 100%;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.welcome-instructions h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.welcome-instructions ol {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--gray-700);
}

.welcome-instructions p {
  color: var(--gray-700);
  font-size: 0.95rem;
}

.grade-pill {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 12px;
}

.correct-pill  { background: var(--green-bg);  color: var(--green); }
.partial-pill  { background: var(--amber-bg);  color: var(--amber); }
.incorrect-pill { background: var(--red-bg); color: var(--red); }

.disclaimer {
  background: var(--gray-100);
  border-left: 3px solid var(--gray-400);
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--gray-700);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.btn-start {
  width: 100%;
  padding: 14px 22px;
  font-size: 1.05rem;
}

/* ===============================
   EXAM HEADER
   =============================== */

header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.header-logo {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-logo-img {
  height: 28px;
  width: auto;
}

.beta-chip {
  background: #f59e0b;
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
}

.progress-label {
  font-size: 0.82rem;
  color: var(--gray-400);
  white-space: nowrap;
}

.score-tally {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-700);
  white-space: nowrap;
}

.progress-bar-track {
  height: 4px;
  background: var(--gray-200);
}

.progress-bar-fill {
  height: 4px;
  background: var(--blue);
  width: 0%;
  transition: width 0.4s ease;
}

/* ===============================
   EXAM MAIN CONTENT
   =============================== */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.area-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
}

/* --- Cards --- */
.card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.card-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
}

.card-label > span {
  flex: 1;
}

.card p {
  font-size: 1rem;
  color: var(--gray-700);
  white-space: pre-wrap;
}

.center-card {
  max-width: 520px;
  margin: 8vh auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.center-card h1 {
  font-size: 1.5rem;
  color: var(--gray-900);
}

.center-card p {
  color: var(--gray-700);
}

.complete-logo {
  height: 60px;
  width: auto;
  margin-bottom: 4px;
}

/* --- Feedback card states --- */
#feedback-card.correct {
  border-color: var(--green);
  background: var(--green-bg);
}

#feedback-card.incorrect {
  border-color: var(--red);
  background: var(--red-bg);
}

#feedback-card.partial {
  border-color: var(--amber);
  background: var(--amber-bg);
}

/* --- Challenge button --- */
.btn-challenge {
  background: none;
  border: 1px solid var(--gray-400);
  color: var(--gray-400);
  border-radius: var(--radius);
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-challenge:hover {
  color: #7c3aed;
  border-color: #7c3aed;
  background: #f5f3ff;
}

.btn-challenge:disabled {
  opacity: 0.6;
  cursor: default;
}

/* --- Textarea --- */
textarea {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--gray-900);
  resize: vertical;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-light);
}

/* --- Buttons --- */
.btn-primary {
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary:hover {
  background: #1648c0;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: white;
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 14px;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: var(--blue-light);
}

/* --- Muted text --- */
.muted {
  color: var(--gray-400);
  font-size: 0.95rem;
  text-align: center;
  padding: 40px;
}

/* ===============================
   SINGLE-AREA RESULT SCREEN
   =============================== */

.big-score {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  margin: 8px 0;
}

.big-score.score-pass { color: var(--green); }
.big-score.score-fail { color: var(--red); }

#single-area-complete .btn-secondary {
  display: block;
  width: 100%;
  margin-top: 16px;
}

#single-area-complete .btn-primary {
  display: block;
  width: 100%;
  margin-top: 8px;
}

/* ===============================
   CHALLENGE MODAL
   =============================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  background: white;
  border-radius: 12px;
  padding: 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-card h2 {
  font-size: 1.2rem;
  color: var(--gray-900);
}

.modal-card p {
  color: var(--gray-700);
  font-size: 0.95rem;
}

.modal-card textarea {
  margin-bottom: 0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-actions .btn-secondary {
  margin-top: 0;
}

/* ===============================
   MOBILE
   =============================== */

@media (max-width: 600px) {
  .welcome-container {
    padding: 24px 16px 48px;
  }

  .welcome-title {
    font-size: 1.6rem;
  }

  .header-inner {
    padding: 8px 14px;
  }

  main {
    padding: 16px 12px 48px;
  }

  .card {
    padding: 16px;
  }

  .modal-card {
    padding: 20px;
  }
}
