/* ============================================
   Beauty Exam Academy — Common Styles
   Shared across Exam + Flashcards
   ============================================ */

/* ----------------------------
   Design Tokens (Exam palette)
   ---------------------------- */
:root {
  /* Surfaces & ink */
  --bg: #FFFFFF;
  --panel: #FDEEEE;
  --panel-hover: #F1C7BD;
  --ink: #2B1F1F;
  --muted: #6E4D45;

  /* Brand */
  --border: #B77467;
  --accent: #B66A5C;
  --accent-weak: #E8B6AB;

  /* States */
  --success: #2F6D4F;
  --danger:  #9B1C1C;

  /* Components */
  --radius: 14px;
  --shadow: 0 8px 24px rgba(183,116,103,0.18);
  --shadow-soft: 0 6px 18px rgba(183,116,103,0.12);

  /* Choices (defaults; pages can override for styling flavor) */
  --choice-bg: var(--panel);
  --choice-bg-hover: var(--panel-hover);
  --choice-correct-bg: #CDE9D6;
  --choice-correct-ink: #104124;
  --choice-correct-ring: #88C29E;
  --choice-wrong-bg: #F7C1C1;
  --choice-wrong-ink: #4B0B0B;
  --choice-wrong-ring: #E99090;
}

/* Dark mode hook */
[data-theme="dark"] {
  --bg: #1C1616;
  --panel: #2B2020;
  --panel-hover: #3B2828;
  --ink: #F5F2F1;
  --muted: #C8B3AB;
  --border: #8A5E52;
  --accent: #D59588;
  --accent-weak: #B67064;

  --success: #7DD4A7;
  --danger:  #F58A8A;

  --choice-bg: #352525;
  --choice-bg-hover: #4A3232;
  --choice-correct-bg: #214233;
  --choice-correct-ink: #D8F5E6;
  --choice-correct-ring: #3F8F6A;
  --choice-wrong-bg: #4E2222;
  --choice-wrong-ink: #FFE8E8;
  --choice-wrong-ring: #B45C5C;
}

/* ----------------------------
   Base / Layout
   ---------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap, .shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

/* ----------------------------
   Global Banner (shared)
   ---------------------------- */
.site-banner {
  width: 100%;
  background: #FCEFF2;
  border-bottom: 1px solid rgba(163, 61, 103, 0.25);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  padding: 6px 20px;
}

.banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1000px;
  margin: 0 auto;
}

.banner-content img { height: 42px; width: auto; display: block; }

.banner-link {
  font-weight: 500;
  text-decoration: none;
  color: var(--accent);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}
.banner-link:hover { color: #7E2E4F; }

/* ----------------------------
   Page Header Row (shared)
   Avoids .site-banner conflict by scoping to main containers
   ---------------------------- */
.wrap > header,
.shell > header,
.topbar { /* .topbar kept for legacy/flashcards */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

/* Optional page title pill used by Exam; generic name to keep reusability */
.title-badge, .title-pill {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  background: var(--panel);
  color: var(--ink);
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

/* Flashcards-style h1 chip (kept as variant) */
.topbar h1 {
  margin: 0;
  padding: 8px 18px;
  border-radius: 14px;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #F3B7C3;
  background-color: #4D2B3A;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.25),
    inset 0 0 1px rgba(255, 255, 255, 0.08);
}
@media (max-width: 640px) { .topbar { flex-wrap: wrap; gap: 8px; } }

/* ----------------------------
   Controls / Buttons
   ---------------------------- */
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

button, .btn {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
}
button:hover, .btn:hover {
  background: var(--panel-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
button:active, .btn:active { transform: translateY(0); }
button:disabled, .btn[disabled] { opacity: .6; cursor: not-allowed; box-shadow: none; }

/* ----------------------------
   Cards / Panels
   ---------------------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card h1, .card h2, .card h3 { margin-top: 0; }

.card-footer, .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #FFF3F4;
  border-top: 1px solid var(--border);
}

/* ----------------------------
   Score / Meta
   ---------------------------- */
.score { font-weight: 700; color: var(--muted); }
.good, .score-good { color: var(--success); }
.bad,  .score-bad  { color: var(--danger); }
.progress { color: var(--muted); }
.tag {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 600;
}

/* Hide legacy Track tag everywhere (per product decision) */
#trackTag { display: none !important; }

/* ----------------------------
   Options (shared)
   ---------------------------- */
.options {
  display: grid;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Button-style options (Flashcards) */
.options button {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--choice-bg);
  color: var(--ink);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-soft);
}
.options button:hover,
.options button:focus {
  background: var(--choice-bg-hover);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

/* Block-style options (Exam) */
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--choice-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease, border-color .15s ease, outline-color .15s ease;
  position: relative;
}
.option:hover { background: var(--choice-bg-hover); }
.option[data-state="selected"] { outline: 3px solid var(--accent-weak); }
.option[data-state="correct"],
.options button.correct {
  background: var(--choice-correct-bg);
  border-color: var(--success);
  color: var(--choice-correct-ink, var(--ink));
  box-shadow: 0 0 0 2px var(--choice-correct-ring) inset;
}
.option[data-state="wrong"],
.options button.wrong {
  background: var(--choice-wrong-bg);
  border-color: var(--danger);
  color: var(--choice-wrong-ink, var(--ink));
  box-shadow: 0 0 0 2px var(--choice-wrong-ring) inset;
}

/* Keycap (used in Exam, but generic) */
.keycap {
  font-weight: 800;
  min-width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

/* ----------------------------
   A11y
   ---------------------------- */
.sr-only, .visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

[tabindex]:focus, button:focus, .btn:focus, .option:focus {
  outline: 3px solid var(--accent-weak);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0s !important; animation-duration: 0s !important; }
}
