/* K Calligraphy - front end + student area */
:root {
  --orange: #F26A1B;
  --orange-deep: #C9520D;
  --orange-soft: #FFF4EC;
  --ink: #2A1C12;
  --paper: #FFFFFF;
  --line: #F1E1D4;
  --muted: #7B6A5E;
  --green: #1E8E4E;
  --red: #C62828;
  --radius-lg: 18px;
  --radius: 10px;
  --shadow: 0 10px 30px -18px rgba(90, 40, 5, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: var(--orange-deep); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { max-width: 820px; }
.narrow-sm { max-width: 460px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 22px;
  font: 600 .95rem/1 'Poppins', sans-serif;
  color: #fff; background: var(--orange);
  border: 2px solid var(--orange); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--orange-deep); border-color: var(--orange-deep); }
.btn-sm { min-height: 38px; padding: 7px 16px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-outline { background: transparent; color: var(--orange-deep); }
.btn-outline:hover { background: var(--orange-soft); color: var(--orange-deep); }
.btn-white { background: #fff; color: var(--orange-deep); border-color: #fff; }
.btn-white:hover { background: var(--orange-soft); border-color: var(--orange-soft); color: var(--orange-deep); }
.btn-ghost-white { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn-ghost-white:hover { background: rgba(255,255,255,.14); border-color: #fff; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; min-height: 70px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand img { height: 48px; width: auto; }
.brand-k {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--orange); color: #fff; font-weight: 800; font-size: 1.35rem;
  transform: skewX(-8deg);
}
.brand-text { font-weight: 700; font-size: 1.15rem; }
.main-nav { display: flex; align-items: center; gap: 26px; }
.main-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.main-nav a:not(.btn):hover { color: var(--orange-deep); }
.nav-toggle { display: none; }

/* ---------- hero: practice-sheet guidelines ---------- */
.hero {
  position: relative; overflow: hidden;
  background-color: var(--orange);
  color: #fff;
  /* ruled writing lines + 55° slant guides, like a calligraphy practice sheet */
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 54px, rgba(255,255,255,.22) 54px 55px, transparent 55px 78px, rgba(255,255,255,.12) 78px 79px, transparent 79px 110px),
    repeating-linear-gradient(55deg, transparent 0 46px, rgba(255,255,255,.07) 46px 47px);
}
.hero-inner {
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 40px;
  padding: 88px 0 96px;
}
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; max-width: 16ch; }
.hero p { font-size: 1.1rem; max-width: 46ch; opacity: .95; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-sheet { position: relative; height: 340px; }
.sheet-letter {
  position: absolute; right: 8%; top: -20px;
  font-size: 300px; line-height: 1; font-weight: 800;
  color: transparent; -webkit-text-stroke: 2px rgba(255,255,255,.9);
  transform: skewX(-12deg);
}
.sheet-letter-2 {
  right: auto; left: 0; top: 120px; font-size: 200px;
  color: rgba(255,255,255,.95); -webkit-text-stroke: 0;
}

/* ---------- sections ---------- */
.section { padding: 72px 0; }
.section-tint { background: var(--orange-soft); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0; padding-bottom: 6px; border-bottom: 3px solid var(--orange); }
.section-head p { margin: 0; }
.page-title { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
.sub-title { margin-top: 48px; }
.back-link { display: inline-block; margin-bottom: 14px; font-size: .9rem; font-weight: 500; text-decoration: none; }
.back-link::before { content: "‹ "; }

/* ---------- course cards ---------- */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.course-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden;
}
.course-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--orange-soft); }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tag {
  position: absolute; top: 12px; left: 12px;
  background: #fff; color: var(--orange-deep); font-size: .75rem; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
}
.course-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.course-meta { font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.course-body h3 { font-size: 1.2rem; margin-bottom: 8px; }
.course-body h3 a { color: var(--ink); text-decoration: none; }
.course-body h3 a:hover { color: var(--orange-deep); }
.course-desc { color: var(--muted); font-size: .93rem; }
.course-start { font-size: .85rem; font-weight: 500; color: var(--orange-deep); }
.course-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 16px; border-top: 1px dashed var(--line); }
.price strong { font-size: 1.3rem; }
.price s { margin-left: 6px; color: var(--muted); font-size: .9rem; }
.price-lg strong { font-size: 2rem; }

/* ---------- steps ---------- */
.steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding-top: 58px; }
.steps li::before {
  content: counter(s);
  position: absolute; top: 0; left: 0;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--orange); color: #fff; font-weight: 700;
}
.steps h3 { font-size: 1.1rem; }
.steps p { color: var(--muted); }

/* ---------- course page ---------- */
.course-hero { background: var(--orange-soft); padding: 48px 0; border-bottom: 1px solid var(--line); }
.course-hero-inner { display: grid; grid-template-columns: 1fr 380px; gap: 48px; align-items: start; }
.course-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 55ch; }
.facts { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.facts li { background: #fff; border-radius: var(--radius); padding: 12px 14px; font-weight: 500; font-size: .93rem; }
.facts span { display: block; font-size: .78rem; color: var(--muted); font-weight: 400; }
.buy-box { background: #fff; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); position: sticky; top: 90px; }
.buy-box img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.buy-inner { padding: 22px; display: grid; gap: 14px; }
.buy-inner .small { margin: 0; }
.course-detail { display: grid; gap: 48px; max-width: 820px; }
.prose { font-size: 1.02rem; }
.preview-block video, .player video { width: 100%; border-radius: var(--radius); background: #000; aspect-ratio: 16 / 9; }
.lesson-list { padding-left: 1.3em; margin: 0; }
.lesson-list li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.lock { font-size: .78rem; color: var(--muted); }
.note { background: var(--orange-soft); padding: 12px 14px; border-radius: var(--radius); font-size: .92rem; margin: 0; }
.note-error { color: var(--red); }

/* ---------- forms & cards ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; }
.card-title { font-size: 1.15rem; }
.auth { background: var(--orange-soft); min-height: 70vh; }
.form { display: grid; gap: 6px; }
.form label { font-size: .88rem; font-weight: 500; margin-top: 10px; }
.form input, .form select, .form textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  font: 400 1rem 'Poppins', sans-serif; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius);
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242,106,27,.18); }
.form input:disabled { background: #faf6f2; color: var(--muted); }
.form .btn { margin-top: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 14px; font-size: .93rem; }
.alert-success { background: #E9F7EF; color: #16633A; }
.alert-error { background: #FDECEC; color: #9E1C1C; }
.alert-info { background: var(--orange-soft); color: var(--orange-deep); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-approved, .badge-active, .badge-published { background: #E9F7EF; color: #16633A; }
.badge-pending { background: #FFF1D6; color: #8A5A00; }
.badge-rejected, .badge-blocked { background: #FDECEC; color: #9E1C1C; }
.badge-draft { background: #EEE; color: #555; }

.empty { text-align: center; padding: 48px 20px; border: 2px dashed var(--line); border-radius: var(--radius-lg); color: var(--muted); }
.empty .btn { margin-top: 8px; }

/* ---------- enroll ---------- */
.summary-row { display: flex; justify-content: space-between; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.big-price { font-size: 1.8rem; color: var(--orange-deep); }
.pay-steps { padding-left: 1.2em; display: grid; gap: 22px; }
.qr { width: 220px; border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0 12px; }
.mobile-only { display: none; }

/* ---------- student dashboard ---------- */
.my-list { display: grid; gap: 16px; }
.my-item { display: grid; grid-template-columns: 160px 1fr auto; gap: 20px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.my-item img { width: 160px; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius); }
.my-body h3 { font-size: 1.1rem; margin-bottom: 2px; }
.my-body p { margin-bottom: 6px; }
.my-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.zoom-card {
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  background: var(--orange); color: #fff; padding: 26px 28px; border-radius: var(--radius-lg);
}
.zoom-card h2 { font-size: 1.3rem; }
.zoom-card p { margin-bottom: 4px; }

.player-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.player h3 { margin-top: 14px; font-size: 1.1rem; }
.playlist { list-style: none; counter-reset: l; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); max-height: 520px; overflow: auto; }
.playlist li { counter-increment: l; border-bottom: 1px solid var(--line); }
.playlist li:last-child { border-bottom: 0; }
.playlist a { display: flex; gap: 12px; padding: 14px 16px; text-decoration: none; color: var(--ink); font-size: .93rem; }
.playlist a::before { content: counter(l); min-width: 24px; height: 24px; border-radius: 50%; background: var(--orange-soft); color: var(--orange-deep); font-size: .75rem; font-weight: 600; display: grid; place-items: center; }
.playlist li.active a { background: var(--orange-soft); font-weight: 600; }
.playlist li.active a::before { background: var(--orange); color: #fff; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #EBDDD2; padding: 56px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-brand { font-size: 1.3rem; font-weight: 700; color: #fff; }
.footer-head { font-weight: 600; color: #fff; margin-bottom: 10px; }
.site-footer a { display: block; color: #EBDDD2; text-decoration: none; padding: 4px 0; font-size: .93rem; }
.site-footer a:hover { color: #fff; }
.muted-light { color: #BCA99A; max-width: 36ch; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 32px; padding-top: 18px; font-size: .85rem; color: #BCA99A; }

.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: #25D366; color: #fff; box-shadow: 0 8px 20px -6px rgba(0,0,0,.35);
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; padding: 56px 0 64px; }
  .hero-sheet { display: none; }
  .course-hero-inner { grid-template-columns: 1fr; }
  .buy-box { position: static; }
  .player-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: grid; gap: 5px; place-content: center;
    width: 44px; height: 44px; border: 0; background: var(--orange-soft); border-radius: 10px; cursor: pointer;
  }
  .nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px 16px 18px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a:not(.btn) { padding: 14px 4px; border-bottom: 1px solid var(--line); }
  .main-nav .btn { margin-top: 14px; }

  .section { padding: 52px 0; }
  .steps { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .course-grid { grid-template-columns: 1fr; }
  .card { padding: 22px 18px; }
  .my-item { grid-template-columns: 96px 1fr; }
  .my-item img { width: 96px; }
  .my-actions { grid-column: 1 / -1; justify-content: stretch; }
  .my-actions .btn { flex: 1; }
  .zoom-card { padding: 22px; }
  .zoom-card .btn { width: 100%; }
  .mobile-only { display: inline-flex; }
  .qr { width: 180px; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
