/* ================================================================
   FlowTaiChi design system
   ================================================================ */

:root {
  --ink: #1d2b26;          /* deep charcoal green */
  --ink-soft: #33443d;
  --jade: #2e7d5b;
  --jade-dark: #226348;
  --jade-soft: #e3efe8;
  --gold: #c9a55c;
  --gold-soft: #f3ead7;
  --paper: #f7f5ef;
  --card: #ffffff;
  --line: #e4e0d4;
  --muted: #6f6b5e;
  --danger: #b04a3a;
  --danger-soft: #f7e5e1;
  --info-soft: #e6ecf5;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(29, 43, 38, .08);
  --shadow-lg: 0 12px 40px rgba(29, 43, 38, .14);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.2; color: var(--ink); }
h1 { font-size: 2.6rem; margin: 0 0 .6rem; }
h2 { font-size: 1.9rem; margin: 0 0 .8rem; }
h3 { font-size: 1.25rem; margin: 1.2rem 0 .5rem; }
h4 { margin: 0 0 .6rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }

p { margin: 0 0 1rem; }
a { color: var(--jade); }
img { max-width: 100%; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 22px; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* ---------------------------------------------------------------- header */

.site-header {
  background: var(--ink);
  position: sticky;
  top: 0;
  z-index: 60;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 66px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 27%, var(--ink) 0 6px, transparent 7px),
    radial-gradient(circle at 50% 73%, var(--gold) 0 6px, transparent 7px),
    linear-gradient(90deg, var(--gold) 50%, #efe9db 50%);
  border: 2px solid var(--gold);
  flex: none;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.28rem;
  color: #efe9db;
  letter-spacing: .02em;
}
.brand-name em { font-style: normal; color: var(--gold); }

.main-nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.main-nav a {
  color: #cfd8d2;
  text-decoration: none;
  font-size: .92rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
}
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.main-nav a.active { color: var(--gold); }

.header-actions { display: flex; gap: 8px; align-items: center; }

.nav-toggle {
  display: none;
  background: none; border: 0; cursor: pointer;
  flex-direction: column; gap: 5px; padding: 8px;
  margin-left: auto;
}
.nav-toggle span { width: 22px; height: 2px; background: #efe9db; display: block; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--jade); color: #fff; }
.btn-primary:hover { background: var(--jade-dark); box-shadow: var(--shadow); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { box-shadow: var(--shadow); }
.btn-outline { border-color: var(--gold); color: var(--gold); background: transparent; }
.btn-outline:hover { background: rgba(201,165,92,.12); }
.btn-outline-dark { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline-dark:hover { background: rgba(29,43,38,.06); }
.btn-ghost { color: #cfd8d2; background: transparent; }
.btn-ghost:hover { color: #fff; background: rgba(255,255,255,.08); }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-lg { padding: 15px 34px; font-size: 1.02rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { display: block; width: 100%; text-align: center; }
button.btn { font-family: var(--font-body); }

/* ---------------------------------------------------------------- hero */

.hero {
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(201,165,92,.22), transparent 60%),
    radial-gradient(700px 420px at 0% 110%, rgba(46,125,91,.28), transparent 60%),
    var(--ink);
  color: #efe9db;
  padding: 92px 0 100px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -140px; top: 50%;
  transform: translateY(-50%);
  width: 460px; height: 460px;
  border-radius: 50%;
  border: 1.5px solid rgba(201,165,92,.35);
  pointer-events: none;
}
.hero h1 {
  color: #f5f1e6;
  font-size: 3.3rem;
  max-width: 640px;
  margin-bottom: 1rem;
}
.hero h1 .accent { color: var(--gold); font-style: italic; }
.hero p.lead {
  font-size: 1.16rem;
  max-width: 560px;
  color: #c8d2cb;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-kicker {
  display: inline-block;
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.1rem;
}

/* ---------------------------------------------------------------- sections */

.section { padding: 72px 0; }
.section-alt { background: #efece2; }
.section-dark { background: var(--ink); color: #d7ddd7; }
.section-dark h2 { color: #f5f1e6; }
.section-head { max-width: 620px; margin-bottom: 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.kicker {
  font-size: .76rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--jade);
  font-weight: 700;
  display: block;
  margin-bottom: .5rem;
}
.section-dark .kicker { color: var(--gold); }

/* ---------------------------------------------------------------- cards & grids */

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
a.card { display: block; text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.program-card .program-emblem {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
  background: var(--jade-soft);
}
.program-card .card-link { color: var(--jade); font-weight: 600; font-size: .92rem; }

.feature-item { display: flex; gap: 14px; align-items: flex-start; }
.feature-item .dot {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gold-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
}
.feature-item strong { display: block; margin-bottom: 2px; }

/* ---------------------------------------------------------------- pricing */

.price-card { position: relative; text-align: center; padding: 36px 28px; }
.price-card.featured { border-color: var(--gold); border-width: 2px; }
.price-tag { font-family: var(--font-display); font-size: 2.8rem; margin: 10px 0 2px; }
.price-tag sup { font-size: 1.2rem; }
.price-period { color: var(--muted); font-size: .9rem; }
.price-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: var(--ink);
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 14px; border-radius: 999px;
}
.price-features { list-style: none; padding: 0; margin: 22px 0 26px; text-align: left; }
.price-features li { padding: 7px 0 7px 28px; border-bottom: 1px dashed var(--line); position: relative; font-size: .93rem; }
.price-features li::before { content: "✓"; position: absolute; left: 4px; color: var(--jade); font-weight: 700; }
.price-features li.no::before { content: "—"; color: var(--muted); }
.price-features li.no { color: var(--muted); }

/* ---------------------------------------------------------------- testimonials */

.testimonial { padding: 26px; }
.testimonial blockquote { margin: 0 0 14px; font-family: var(--font-display); font-size: 1.02rem; font-style: italic; color: var(--ink-soft); }
.testimonial .who { font-size: .85rem; color: var(--muted); }
.testimonial .who strong { color: var(--ink); }

/* ---------------------------------------------------------------- forms */

.form-card { max-width: 520px; margin: 0 auto; }
.form-group { margin-bottom: 18px; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=tel], select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(46,125,91,.14);
}
textarea { min-height: 110px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* ---------------------------------------------------------------- flash */

.flash-stack { margin-top: 18px; }
.flash {
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: .93rem;
  border: 1px solid transparent;
}
.flash-success { background: var(--jade-soft); color: var(--jade-dark); border-color: #c4ddd0; }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: #e8c8c1; }
.flash-info { background: var(--info-soft); color: #33507a; border-color: #ccd8ea; }
.flash-achievement { background: var(--gold-soft); color: #7a5c1e; border-color: #e5d3ac; }

.renew-banner {
  background: var(--gold-soft);
  border-bottom: 1px solid #e5d3ac;
  padding: 10px 0;
  font-size: .9rem;
  color: #7a5c1e;
}

/* ---------------------------------------------------------------- page headers */

.page-head {
  background:
    radial-gradient(700px 300px at 90% -40%, rgba(201,165,92,.2), transparent 60%),
    var(--ink);
  color: #d7ddd7;
  padding: 56px 0;
}
.page-head h1 { color: #f5f1e6; margin-bottom: .4rem; }
.page-head p { max-width: 640px; margin: 0; color: #b9c4bd; }
.breadcrumbs { font-size: .82rem; margin-bottom: 12px; color: #97a59d; }
.breadcrumbs a { color: var(--gold); text-decoration: none; }

/* ---------------------------------------------------------------- badges & meta */

.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--jade-soft);
  color: var(--jade-dark);
}
.badge-gold { background: var(--gold-soft); color: #7a5c1e; }
.badge-dark { background: var(--ink); color: #efe9db; }
.badge-free { background: var(--info-soft); color: #33507a; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

.meta-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); align-items: center; }
.meta-row span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------------------------------------------------------------- lesson content */

.lesson-body { font-size: 1.02rem; }
.lesson-body h3 {
  font-size: 1.3rem;
  margin-top: 2rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--gold-soft);
}
.lesson-body ol, .lesson-body ul { padding-left: 1.4rem; margin-bottom: 1.1rem; }
.lesson-body li { margin-bottom: .45rem; }
.lesson-body p { margin-bottom: 1.05rem; }

.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li { border-bottom: 1px solid var(--line); }
.lesson-list li:last-child { border-bottom: 0; }
.lesson-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 6px;
  text-decoration: none;
  color: var(--ink);
}
.lesson-list a:hover { background: #faf8f2; }
.lesson-num {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--jade-soft);
  color: var(--jade-dark);
  font-weight: 700;
  font-size: .82rem;
  display: flex; align-items: center; justify-content: center;
}
.lesson-num.done { background: var(--jade); color: #fff; }
.lesson-list .lesson-title { flex: 1; font-weight: 500; }
.lesson-list .lesson-meta { font-size: .8rem; color: var(--muted); display: flex; gap: 10px; align-items: center; }

.locked-note {
  background: var(--gold-soft);
  border: 1px solid #e5d3ac;
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
}

/* ---------------------------------------------------------------- dashboard */

.stat-card { text-align: center; padding: 22px 14px; }
.stat-value { font-family: var(--font-display); font-size: 2.1rem; line-height: 1.1; color: var(--jade-dark); }
.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 4px; }

.progress-bar { background: #e8e4d8; border-radius: 999px; height: 10px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--jade), #48a37c); border-radius: 999px; }
.progress-bar.gold > span { background: linear-gradient(90deg, #b8913f, var(--gold)); }

.achievement-tile {
  text-align: center;
  padding: 16px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
}
.achievement-tile.locked { opacity: .38; filter: grayscale(1); }
.achievement-tile .icon { font-size: 1.7rem; }
.achievement-tile .name { font-size: .8rem; font-weight: 600; margin-top: 6px; }
.achievement-tile .pts { font-size: .72rem; color: var(--muted); }

.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.activity-list li:last-child { border-bottom: 0; }
.activity-list .when { margin-left: auto; color: var(--muted); font-size: .8rem; white-space: nowrap; }

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  font-size: .92rem;
}
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { background: #f1eee4; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #faf8f2; }

/* ---------------------------------------------------------------- challenges */

.challenge-days { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.day-pip {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 600;
  color: var(--muted);
}
.day-pip.done { background: var(--jade); border-color: var(--jade); color: #fff; }
.day-pip.today { border-color: var(--gold); color: var(--ink); box-shadow: 0 0 0 3px rgba(201,165,92,.25); }

/* ---------------------------------------------------------------- blog */

.post-card .post-date { font-size: .8rem; color: var(--muted); }
.post-card h3 { margin: 6px 0 8px; }
.post-body { font-size: 1.04rem; }
.post-body h3 { margin-top: 2rem; }

/* ---------------------------------------------------------------- FAQ */

details.faq-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  padding: 0 20px;
}
details.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 16px 0;
  list-style: none;
  position: relative;
  padding-right: 30px;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after { content: "+"; position: absolute; right: 2px; top: 12px; font-size: 1.3rem; color: var(--gold); }
details.faq-item[open] summary::after { content: "–"; }
details.faq-item .answer { padding: 0 0 16px; color: var(--ink-soft); }

/* ---------------------------------------------------------------- footer */

.site-footer { background: var(--ink); color: #97a59d; margin-top: 80px; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 30px;
  padding: 54px 22px 30px;
}
.footer-grid h4 { color: #cfd8d2; }
.footer-grid a { display: block; color: #97a59d; text-decoration: none; padding: 3px 0; font-size: .92rem; }
.footer-grid a:hover { color: var(--gold); }
.footer-brand { margin-bottom: 10px; }
.footer-tag { font-size: .9rem; max-width: 260px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .8rem;
}

/* ---------------------------------------------------------------- admin */

.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 30px; align-items: start; padding: 34px 0 60px; }
.admin-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; position: sticky; top: 86px; }
.admin-nav a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  font-size: .92rem;
  font-weight: 500;
}
.admin-nav a:hover { background: var(--paper); }
.admin-nav a.active { background: var(--jade-soft); color: var(--jade-dark); }
.admin-nav .nav-sep { border-top: 1px solid var(--line); margin: 8px 0; }
.admin-content h1 { font-size: 1.9rem; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.inline-form { display: inline; }

/* ---------------------------------------------------------------- helpers */

.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 36px; }
.mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .admin-nav .nav-sep { display: none; }
  .hero h1 { font-size: 2.6rem; }
}

@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero { padding: 60px 0; }
  .hero h1 { font-size: 2.1rem; }
  .section { padding: 48px 0; }

  .nav-toggle { display: flex; }
  .main-nav, .header-actions {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 12px;
  }
  .header-inner { flex-wrap: wrap; }
  body.nav-open .main-nav, body.nav-open .header-actions { display: flex; }
  .header-actions { flex-direction: row; }
  .header-actions .btn { flex: 1; text-align: center; }
}
