/* ============================================================
   PACEDEMY — style.css
   ============================================================ */

:root {
  --ink:      #0C2422;
  --ink-soft: #14403C;
  --teal:     #2A7F76;
  --teal-dim: #7FA8A2;
  --gold:     #F0A830;
  --gold-dim: #FBE6BE;
  --mist:     #E7EDE9;
  --paper:    #FFFFFF;
  --line:     #C9D8D3;
  --danger:   #B4432E;

  --ui:   'Be Vietnam Pro', system-ui, sans-serif;
  --disp: 'Bricolage Grotesque', Georgia, serif;

  --wrap: 1120px;
  --r:    4px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.hidden { display: none !important; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Thương hiệu ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--disp);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--gold);
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-45deg);
}

/* ---------- Thanh điều hướng ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.94rem;
}

/* ---------- Nút ---------- */

.btn {
  display: inline-block;
  font-family: var(--ui);
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 13px 24px;
  border: 1.5px solid transparent;
  border-radius: var(--r);
  background: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}

.btn-gold  { background: var(--gold); color: var(--ink); }
.btn-gold:hover  { background: #FFBB4B; }

.btn-ink   { background: var(--ink); color: #fff; }
.btn-ink:hover   { background: var(--ink-soft); }

.btn-line  { border-color: var(--line); color: var(--ink); }
.btn-line:hover  { background: var(--mist); }

.btn-full  { width: 100%; }

.btn-quiet {
  padding: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================================
   VÒNG LẶP — Learn. Practice. Review. Repeat.
   ============================================================ */

.cycle {
  position: relative;
  width: 210px;
  height: 264px;
  flex-shrink: 0;
}

.cycle-line {
  position: absolute;
  inset: 0;
  width: 210px;
  height: 264px;
}

.cycle-list {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
  height: 100%;
}

.beat {
  position: absolute;
  left: 64px;
  height: 66px;
  display: flex;
  align-items: center;
  font-family: var(--disp);
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--teal-dim);
  transition: color .35s ease;
}

.beat:nth-child(1) { top: 0; }
.beat:nth-child(2) { top: 66px; }
.beat:nth-child(3) { top: 132px; }
.beat:nth-child(4) { top: 198px; }

.beat .dot {
  position: absolute;
  left: -32px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--teal-dim);
  border-radius: 50%;
  background: var(--ink);
  transition: background-color .35s ease, border-color .35s ease, transform .35s ease;
}

.beat.on { color: var(--gold); }
.beat.on .dot {
  background: var(--gold);
  border-color: var(--gold);
  transform: scale(1.45);
}

.cycle-light .beat { color: rgba(12, 36, 34, .34); }
.cycle-light .beat .dot { background: var(--paper); border-color: var(--line); }
.cycle-light .beat.on { color: var(--ink); }
.cycle-light .beat.on .dot { background: var(--gold); border-color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  .beat, .beat .dot { transition: none; }
}

/* ============================================================
   TRANG CHỦ
   ============================================================ */

.home { background: var(--ink); color: var(--mist); }
.home .brand { color: var(--mist); }
.home .topbar-links a { color: var(--mist); text-decoration: none; }
.home .topbar-links a:hover { color: var(--gold); }

.hero {
  display: flex;
  align-items: center;
  gap: 72px;
  padding: 76px 0 92px;
}

.hero-copy { max-width: 34rem; }

.hero h1 {
  margin: 0 0 22px;
  font-family: var(--disp);
  font-size: clamp(2.5rem, 5.6vw, 4rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--paper);
}

.hero p {
  margin: 0 0 32px;
  font-size: 1.08rem;
  line-height: 1.68;
  color: rgba(231, 237, 233, .82);
  max-width: 30rem;
}

.hero-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

.home .btn-line { border-color: rgba(231,237,233,.34); color: var(--mist); }
.home .btn-line:hover { background: rgba(231,237,233,.1); }

/* Dải module dưới hero */

.strip { background: var(--mist); padding: 54px 0 60px; }

.strip-head {
  font-family: var(--disp);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 26px;
}

.strip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.strip-item { background: var(--mist); padding: 24px 22px 26px; }

.strip-item h3 {
  margin: 0 0 7px;
  font-size: 1.02rem;
  font-weight: 600;
}

.strip-item p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #4A635E;
}

.strip-num {
  display: block;
  font-family: var(--disp);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 12px;
}

/* ============================================================
   ĐĂNG NHẬP / ĐĂNG KÝ
   ============================================================ */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-side {
  background: var(--ink);
  color: var(--mist);
  padding: 40px 52px 52px;
  display: flex;
  flex-direction: column;
}

.auth-side .brand { color: var(--mist); text-decoration: none; }

.auth-side-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 34px;
}

.auth-tag {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.7;
  color: rgba(231, 237, 233, .78);
  max-width: 24rem;
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card { width: 100%; max-width: 384px; }

.auth-card h1 {
  margin: 0 0 6px;
  font-family: var(--disp);
  font-size: 1.86rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-card .lead {
  margin: 0 0 30px;
  font-size: 0.95rem;
  color: #4A635E;
}

.field { margin-bottom: 17px; }

.field label {
  display: block;
  font-size: 0.87rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  font-family: var(--ui);
  font-size: 0.98rem;
  color: var(--ink);
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
}

.field input:focus,
.field select:focus {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(42, 127, 118, .16);
}

.field-hint {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: #6C837E;
}

.auth-foot {
  margin: 22px 0 0;
  font-size: 0.9rem;
  color: #4A635E;
  text-align: center;
}

.note {
  padding: 11px 14px;
  border-radius: var(--r);
  font-size: 0.89rem;
  line-height: 1.5;
  margin-bottom: 18px;
}

.note-bad  { background: #F8E7E3; color: var(--danger); border-left: 3px solid var(--danger); }
.note-good { background: var(--gold-dim); color: #6B4A05; border-left: 3px solid var(--gold); }

/* ============================================================
   BẢNG ĐIỀU KHIỂN
   ============================================================ */

.app-bar {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.app-bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

.app-user { display: flex; align-items: center; gap: 18px; font-size: 0.92rem; }

.streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: var(--gold-dim);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6B4A05;
}

.greet { padding: 44px 0 30px; }

.greet h1 {
  margin: 0 0 6px;
  font-family: var(--disp);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.greet p { margin: 0; color: #4A635E; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 46px;
}

.stat { background: var(--paper); padding: 20px 22px 22px; }

.stat-num {
  display: block;
  font-family: var(--disp);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-lab { font-size: 0.86rem; color: #4A635E; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--disp);
  font-size: 1.24rem;
  font-weight: 600;
}

.modules {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.module {
  display: block;
  padding: 24px 24px 26px;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease;
}

.module:hover { border-color: var(--teal); }

.module h3 {
  margin: 0 0 6px;
  font-size: 1.06rem;
  font-weight: 600;
}

.module p {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #4A635E;
}

.module-meta { font-size: 0.85rem; font-weight: 600; color: var(--teal); }

.module.soon { background: var(--mist); border-style: dashed; }
.module.soon:hover { border-color: var(--line); }
.module.soon .module-meta { color: #6C837E; }

.board { width: 100%; border-collapse: collapse; font-size: 0.94rem; }

.board th {
  text-align: left;
  font-size: 0.84rem;
  font-weight: 600;
  color: #4A635E;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
}

.board td { padding: 13px 12px; border-bottom: 1px solid var(--mist); }

.board tr.me td { background: var(--gold-dim); font-weight: 600; }

.board .rank {
  font-family: var(--disp);
  font-weight: 700;
  width: 46px;
  color: var(--teal);
}

.empty {
  padding: 30px 0;
  color: #6C837E;
  font-size: 0.94rem;
}

.app-foot {
  margin-top: 60px;
  padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  font-family: var(--disp);
  font-size: 0.9rem;
  color: #6C837E;
}

/* ============================================================
   MÀN HÌNH NHỎ
   ============================================================ */

@media (max-width: 900px) {
  .hero { flex-direction: column-reverse; align-items: flex-start; gap: 44px; padding: 44px 0 64px; }
  .strip-grid { grid-template-columns: repeat(2, 1fr); }
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth-side { padding: 26px 28px 34px; }
  .auth-side-mid { flex-direction: row; align-items: center; gap: 28px; padding: 18px 0; }
  .auth-tag { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .modules { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .topbar-links { gap: 14px; }
  .strip-grid { grid-template-columns: 1fr; }
  .greet h1 { font-size: 1.7rem; }
  .board .hide-sm { display: none; }
}
