/* ====================================
   ZARION QUIZ — Shared Styles
   zarionquiz.zarion.us
   ==================================== */

/* ---------- Variables ---------- */
:root {
  --orange: #E8610A;
  --dark: #1A1A1A;
  --bg: #f5f4f0;
  --white: #ffffff;
  --gray-100: #f9f9f7;
  --gray-200: #e8e8e4;
  --gray-400: #aaaaaa;
  --gray-500: #888888;
  --gray-600: #555550;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --header-h: 56px;
  --max-w: 960px;
  --px: 16px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--dark);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
img { display: block; max-width: 100%; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--px);
}
.main-content {
  padding-top: calc(var(--header-h) + 24px);
  padding-bottom: 48px;
  min-height: 100vh;
}

/* ====================================
   HEADER
   ==================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--dark);
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: flex; flex-direction: column; line-height: 1.2; }
.logo-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.06em;
}
.logo-sub {
  font-size: 10px;
  color: var(--gray-500);
  font-weight: 400;
  letter-spacing: 0.02em;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.85);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: background .2s;
}
.btn-back:hover { background: rgba(255,255,255,.14); }

/* ====================================
   INDEX — Hero
   ==================================== */
.index-hero {
  padding: 28px 0 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--gray-200);
}
.index-hero h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
}
.index-hero p {
  font-size: 14px;
  color: var(--gray-600);
  max-width: 460px;
  line-height: 1.6;
}

/* ====================================
   INDEX — Module Grid
   ==================================== */
.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.module-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .2s, box-shadow .2s;
  color: inherit;
}
.module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.module-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.module-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
}
.module-sub {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: -4px;
}
.module-desc {
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.5;
  flex: 1;
}
.module-sections {
  font-size: 10px;
  color: var(--gray-400);
  padding: 6px 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  letter-spacing: 0.02em;
}
.module-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
  background: var(--orange);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  transition: opacity .2s;
}
.module-btn:hover { opacity: .88; }

/* ====================================
   TOPIC — Hero Card
   ==================================== */
.topic-hero {
  background: var(--dark);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  margin-bottom: 16px;
  color: var(--white);
}
.topic-hero-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.topic-hero-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
}
.topic-hero-sub {
  font-size: 12px;
  color: var(--gray-500);
}

/* ====================================
   TABS
   ==================================== */
.tabs-nav {
  display: flex;
  gap: 3px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 3px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.tab-btn {
  flex: 1;
  padding: 10px 6px;
  background: transparent;
  color: var(--gray-500);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  transition: all .2s;
  text-align: center;
  white-space: nowrap;
}
.tab-btn.active { background: var(--dark); color: var(--white); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ====================================
   RESUMEN — Section blocks
   ==================================== */
.section-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 10px;
}
.card-block {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.analogy-text {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.75;
}

/* Rules */
.rules-list { display: flex; flex-direction: column; gap: 10px; }
.rule-item { display: flex; gap: 12px; align-items: flex-start; }
.rule-num {
  width: 26px; height: 26px; min-width: 26px;
  background: var(--orange);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.rule-text {
  font-size: 13px;
  color: var(--dark);
  line-height: 1.5;
  padding-top: 4px;
}
.rule-text strong { color: var(--orange); }

/* Type cards — accordion */
.types-section { margin-bottom: 12px; }
.type-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  margin-bottom: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: box-shadow .2s;
  user-select: none;
}
.type-card.open {
  box-shadow: var(--shadow-md);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: 0;
}
.type-tag {
  font-size: 9px;
  font-weight: 700;
  color: var(--orange);
  background: rgba(232,97,10,.10);
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.type-info { flex: 1; min-width: 0; }
.type-name { font-size: 13px; font-weight: 700; color: var(--dark); }
.type-brief { font-size: 11px; color: var(--gray-500); margin-top: 1px; }
.type-chevron {
  font-size: 11px;
  color: var(--gray-400);
  transition: transform .2s;
  flex-shrink: 0;
}
.type-card.open .type-chevron { transform: rotate(180deg); }
.type-detail {
  display: none;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-top: none;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.7;
}
.type-detail strong { color: var(--dark); }
.type-detail em { color: var(--orange); font-style: normal; font-weight: 600; }

/* Mnemonics */
.mnemonic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mnemonic-card {
  background: var(--dark);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: 14px;
}
.mnemonic-letters {
  font-size: 20px;
  font-weight: 800;
  color: var(--orange);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}
.mnemonic-equals {
  font-size: 11px;
  color: var(--gray-500);
  margin-bottom: 6px;
}
.mnemonic-desc {
  font-size: 11px;
  color: rgba(255,255,255,.65);
  line-height: 1.5;
}

/* ====================================
   FLASHCARDS
   ==================================== */
.flashcard-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 14px;
}
.fc-counter {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}
.fc-wrap {
  width: 100%;
  max-width: 400px;
  height: 210px;
  perspective: 1000px;
  cursor: pointer;
}
.fc-inner {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .45s cubic-bezier(.4,0,.2,1);
}
.fc-wrap.flipped .fc-inner { transform: rotateY(180deg); }
.card-face {
  position: absolute;
  width: 100%; height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 22px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.card-face.front { background: var(--dark); color: var(--white); }
.card-face.back { background: var(--orange); color: var(--white); transform: rotateY(180deg); }
.card-face-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: .55;
  margin-bottom: 10px;
}
.card-face-text { font-size: 15px; font-weight: 600; line-height: 1.45; }
.card-face-hint { font-size: 10px; opacity: .45; margin-top: 12px; }

.fc-controls { display: flex; align-items: center; gap: 14px; }
.btn-nav {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--white);
  color: var(--dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  box-shadow: var(--shadow);
  transition: background .15s;
}
.btn-nav:hover:not(:disabled) { background: var(--gray-200); }
.btn-nav:disabled { opacity: .3; cursor: not-allowed; }

/* ====================================
   QUIZ
   ==================================== */
.quiz-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  box-shadow: var(--shadow);
}
.quiz-progress-wrap {
  height: 3px;
  background: var(--gray-200);
  border-radius: 2px;
  margin-bottom: 14px;
  overflow: hidden;
}
.quiz-progress-bar {
  height: 100%;
  background: var(--orange);
  border-radius: 2px;
  transition: width .3s;
}
.quiz-counter-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-bottom: 10px;
  font-weight: 500;
}
.quiz-q-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.45;
  margin-bottom: 16px;
}
.quiz-opts { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.quiz-opt {
  width: 100%;
  padding: 12px 14px;
  background: var(--gray-100);
  color: var(--dark);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  border: 2px solid transparent;
  transition: all .15s;
  line-height: 1.4;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--orange); background: var(--white); }
.quiz-opt.wrong { background: #FDECEA; border-color: #E74C3C; color: #C0392B; }
.quiz-opt.correct { background: #EAF7ED; border-color: #27AE60; color: #1a7a3e; }
.quiz-feedback {
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 12px;
}
.quiz-feedback.ok { background: #EAF7ED; color: #1a7a3e; }
.quiz-feedback.no { background: #FDECEA; color: #C0392B; }
.btn-next {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--orange);
  color: var(--white);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  transition: opacity .2s;
}
.btn-next:hover { opacity: .88; }

/* Quiz results */
.quiz-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 16px;
  gap: 10px;
}
.result-emoji { font-size: 48px; }
.result-score { font-size: 34px; font-weight: 800; color: var(--dark); }
.result-pct { font-size: 18px; font-weight: 700; color: var(--orange); }
.result-msg { font-size: 14px; color: var(--gray-600); max-width: 260px; line-height: 1.5; }
.btn-restart {
  margin-top: 6px;
  padding: 11px 26px;
  background: var(--dark);
  color: var(--white);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  transition: opacity .2s;
}
.btn-restart:hover { opacity: .85; }

/* ====================================
   FOOTER
   ==================================== */
.site-footer {
  margin-top: 40px;
  padding: 18px var(--px);
  text-align: center;
  font-size: 11px;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
}

/* ====================================
   RESPONSIVE
   ==================================== */
@media (min-width: 540px) {
  :root { --px: 20px; }
  .module-grid { gap: 14px; }
  .module-title { font-size: 16px; }
}

@media (min-width: 768px) {
  :root { --px: 28px; }
  .module-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .index-hero h1 { font-size: 34px; }
  .index-hero p { font-size: 15px; }
  .topic-hero { padding: 28px 24px; }
  .topic-hero-title { font-size: 28px; }
  .card-block { padding: 20px; }
  .mnemonic-grid { gap: 12px; }
  .fc-wrap { height: 230px; }
  .card-face-text { font-size: 16px; }
}
