/* ===== KEGELIO — Member App · BVI biru-putih clinical-trust ===== */
:root {
  --blue: #1d6fe5;
  --navy: #0a2540;
  --teal: #17c3ce;
  --surface: #f4f8fd;
  --white: #ffffff;
  --slate: #5a6b82;
  --ink: #0f2033;
  --green: #22c55e;
  --amber: #f59e0b;
  --line: #e4edf7;
  --shadow: 0 4px 20px rgba(10, 37, 64, 0.08);
  --shadow-lg: 0 12px 40px rgba(10, 37, 64, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 480px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
h1, h2, h3, h4 { font-family: "Poppins", "Inter", sans-serif; color: var(--ink); line-height: 1.2; }
a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ===== Layout ===== */
#app { min-height: 100%; }
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--surface);
  position: relative;
  padding-bottom: 84px; /* space for bottom nav */
}
.page { padding: 18px 18px 8px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== Top bar ===== */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(244, 248, 253, 0.9);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.topbar .logo { display: flex; align-items: center; gap: 7px; font-family: "Poppins"; font-weight: 700; color: var(--navy); font-size: 19px; }
.topbar .logo svg { width: 26px; height: 26px; }
.topbar .logo .lm { height: 22px; width: auto; }
.topbar .greet { font-size: 13px; color: var(--slate); font-weight: 500; }

/* ===== Cards ===== */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px;
  border: 1px solid var(--line);
}
.card.flush { padding: 0; overflow: hidden; }

/* ===== Progress hero ===== */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #113a63 60%, var(--blue) 130%);
  color: #fff; border-radius: 22px; padding: 22px; box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden; margin-bottom: 16px;
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(23,195,206,.35), transparent 70%);
}
.hero h1, .hero h2, .hero h3 { color: #fff; }
.hero .ring-wrap { display: flex; align-items: center; gap: 18px; position: relative; z-index: 2; }
.ring { position: relative; width: 104px; height: 104px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .num b { font-family: "Poppins"; font-size: 26px; line-height: 1; }
.ring .num span { font-size: 11px; opacity: .8; }
.hero .meta { flex: 1; }
.hero .meta .lvl { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; opacity: .82; font-weight: 600; }
.hero .meta .lvl-nama { font-family: "Poppins"; font-size: 20px; font-weight: 600; margin: 2px 0 8px; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: rgba(255,255,255,.16); border-radius: 20px; padding: 5px 11px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.chip.streak { background: rgba(245,158,11,.9); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--blue); color: #fff; border: none; border-radius: 14px;
  padding: 14px 18px; font-size: 15px; font-weight: 600; width: 100%;
  transition: transform .08s, box-shadow .2s, background .2s;
  box-shadow: 0 6px 18px rgba(29,111,229,.28);
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn.teal { background: var(--teal); box-shadow: 0 6px 18px rgba(23,195,206,.3); }
.btn.ghost { background: var(--white); color: var(--blue); border: 1.5px solid var(--line); box-shadow: none; }
.btn.dark { background: var(--navy); box-shadow: none; }
.btn.sm { padding: 10px 14px; font-size: 14px; width: auto; }
.btn.done { background: var(--green); box-shadow: none; }
.btn:disabled { opacity: .55; cursor: default; }

/* ===== Icon sizing (inline SVG default besar — batasi per konteks) ===== */
.btn svg { width: 20px; height: 20px; flex: none; }
.note svg { width: 20px; height: 20px; flex: none; }
.chip svg, .pill svg { width: 15px; height: 15px; flex: none; }
.back-btn svg { width: 18px; height: 18px; flex: none; }
.mod svg { width: 22px; height: 22px; flex: none; }
.acc-head .ic svg { width: 20px; height: 20px; }
.acc-head .caret svg { width: 20px; height: 20px; }
.state-dot svg { width: 15px; height: 15px; }
.check .box svg { width: 16px; height: 16px; }
.video-ph .play svg { width: 26px; height: 26px; margin-left: 3px; }
.today-label svg, .sec-title svg { width: 15px; height: 15px; }

/* ===== Today card ===== */
.today-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); font-weight: 700; margin-bottom: 4px; }
.today h2 { font-size: 20px; margin-bottom: 6px; }
.today .fokus { color: var(--slate); font-size: 14px; margin-bottom: 14px; }
.pill-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.pill { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--navy); display: inline-flex; align-items: center; gap: 6px; }

/* ===== Section titles ===== */
.sec-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--slate); font-weight: 700; margin: 20px 4px 10px; }

/* ===== Module grid ===== */
.mod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mod {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); text-align: left; color: var(--ink);
  display: flex; flex-direction: column; gap: 8px; transition: transform .1s, box-shadow .2s;
}
.mod:active { transform: scale(.98); }
.mod .ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--surface); }
.mod .ic svg { width: 22px; height: 22px; }
.mod h3 { font-size: 15px; }
.mod p { font-size: 12.5px; color: var(--slate); }

/* ===== Level / program list ===== */
.level-head { display: flex; align-items: center; gap: 10px; margin: 18px 4px 10px; }
.level-badge { width: 34px; height: 34px; border-radius: 10px; color: #fff; display: flex; align-items: center; justify-content: center; font-family: "Poppins"; font-weight: 700; font-size: 15px; }
.level-head .t { font-family: "Poppins"; font-weight: 600; font-size: 16px; }
.level-head .r { font-size: 12px; color: var(--slate); }
.day-row {
  display: flex; align-items: center; gap: 12px; background: var(--white);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(10,37,64,.04); transition: transform .08s;
}
.day-row:active { transform: scale(.99); }
.day-row.locked { opacity: .55; }
.day-num { width: 42px; height: 42px; border-radius: 11px; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; border: 1px solid var(--line); }
.day-num b { font-family: "Poppins"; font-size: 16px; color: var(--navy); line-height: 1; }
.day-num span { font-size: 9px; color: var(--slate); text-transform: uppercase; }
.day-row .info { flex: 1; min-width: 0; }
.day-row .info h4 { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-row .info p { font-size: 12px; color: var(--slate); }
.day-row .state { flex: none; }
.state-dot { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.state-dot.done { background: var(--green); color: #fff; }
.state-dot.open { border: 2px solid var(--blue); }
.state-dot.lock { color: var(--slate); }

/* ===== Video player ===== */
.video-box { position: relative; background: var(--navy); aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; }
.video-box video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-ph { display: flex; flex-direction: column; align-items: center; gap: 10px; color: rgba(255,255,255,.9); text-align: center; padding: 20px; }
.video-ph .play { width: 62px; height: 62px; border-radius: 50%; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; border: 2px solid rgba(255,255,255,.4); }
.video-ph small { font-size: 12px; opacity: .7; max-width: 260px; }

/* ===== Exercise list ===== */
.ex { border-left: 3px solid var(--teal); padding: 4px 0 4px 14px; margin-bottom: 14px; }
.ex h4 { font-size: 14.5px; margin-bottom: 3px; }
.ex p { font-size: 13.5px; color: var(--slate); }

/* ===== Checklist ===== */
.check { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check:last-child { border-bottom: none; }
.check .box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); flex: none; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.check.on .box { background: var(--green); border-color: var(--green); color: #fff; }
.check span { font-size: 14px; }
.check.on span { color: var(--slate); }

/* ===== Note box ===== */
.note { background: #eef6ff; border: 1px solid #d6e8ff; border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--navy); display: flex; gap: 10px; }
.note svg { flex: none; color: var(--blue); margin-top: 1px; }
.note.warn { background: #fff8ec; border-color: #ffe6bd; color: #7a5200; }
.note.warn svg { color: var(--amber); }

/* ===== Breathing timer ===== */
.breath-stage { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 24px 0; }
.breath-orb {
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, var(--teal), var(--blue));
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 0 60px rgba(23,195,206,.45); transition: transform 1s ease-in-out;
}
.breath-orb .phase { text-align: center; }
.breath-orb .phase b { font-family: "Poppins"; font-size: 22px; display: block; }
.breath-orb .phase span { font-size: 40px; font-family: "Poppins"; font-weight: 700; }
.breath-controls { display: flex; gap: 10px; width: 100%; }

/* ===== Herbal / habit item ===== */
.acc { background: var(--white); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(10,37,64,.04); }
.acc-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.acc-head .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--blue); flex: none; }
.acc-head .t { flex: 1; }
.acc-head .t h4 { font-size: 15px; }
.acc-head .t p { font-size: 12px; color: var(--slate); }
.acc-head .caret { transition: transform .2s; color: var(--slate); }
.acc.open .acc-head .caret { transform: rotate(180deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.acc.open .acc-body { max-height: 800px; }
.acc-body-inner { padding: 0 16px 16px; }
.recipe h5 { font-size: 13px; color: var(--navy); margin: 10px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.recipe ul, .recipe ol { padding-left: 18px; font-size: 13.5px; color: var(--slate); }
.recipe li { margin-bottom: 4px; }
.badge-freq { display: inline-block; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--navy); margin-top: 8px; }

/* ===== Bottom nav ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--maxw); background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; padding: 8px 4px 10px; z-index: 40;
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--slate); font-size: 10.5px; font-weight: 600; padding: 4px 8px; border-radius: 10px; background: none; border: none; flex: 1; }
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--blue); }

/* ===== Login ===== */
.auth { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 28px 22px; }
.auth .brand { display: flex; align-items: center; justify-content: center; margin-bottom: 2px; }
.auth .brand .lm-big { width: 210px; max-width: 70%; height: auto; }
.auth .wordmark { text-align: center; font-family: "Poppins"; font-weight: 700; font-size: 34px; color: var(--navy); letter-spacing: -0.5px; margin-top: -6px; }
.auth .sub { text-align: center; color: var(--slate); font-size: 14px; margin: 4px 0 26px; }
.key-inp { font-family: "Courier New", monospace; letter-spacing: 1.5px; text-transform: uppercase; }
.auth .card { padding: 22px; }
.tabs { display: flex; background: var(--surface); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.tabs button { flex: 1; padding: 10px; border: none; background: none; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--slate); }
.tabs button.active { background: var(--white); color: var(--navy); box-shadow: 0 2px 8px rgba(10,37,64,.08); }
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
input.inp { width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 15px; font-family: inherit; background: var(--surface); transition: border .15s; }
input.inp:focus { outline: none; border-color: var(--blue); background: #fff; }
.auth .hint { font-size: 12px; color: var(--slate); text-align: center; margin-top: 14px; }
.msg { font-size: 13px; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; display: none; }
.msg.err { background: #fdecec; color: #b42318; display: block; }
.msg.ok { background: #eafaf0; color: #1a7f45; display: block; }

/* ===== misc ===== */
.back-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--slate); font-size: 14px; font-weight: 600; background: none; border: none; padding: 4px 0; margin-bottom: 10px; }
.demo-banner { background: var(--amber); color: #422c00; font-size: 12px; font-weight: 600; text-align: center; padding: 6px; }
.center-empty { text-align: center; color: var(--slate); padding: 40px 20px; font-size: 14px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.disc { font-size: 11.5px; color: var(--slate); line-height: 1.5; padding: 14px 4px 4px; }
