/* ============ RUANG MAGNET HATI ============ */
:root {
  --maroon: #6f294d;
  --maroon-deep: #4c1d35;
  --rose: #a8546f;
  --rose-soft: #f3e2e9;
  --gold: #b98a5f;
  --cream: #faf6f1;
  --card: #ffffff;
  --ink: #3a2a32;
  --ink-soft: #7d6a72;
  --line: #ecdfe6;
  --ok: #2e7d4f;
  --warn: #b3801a;
  --danger: #b3392e;
  --radius: 16px;
  --shadow: 0 2px 14px rgba(111, 41, 77, 0.08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
  background: var(--cream);
  color: var(--ink);
}
h1, h2, h3, .brand { font-family: 'Lora', Georgia, serif; color: var(--maroon-deep); }
h1 { font-size: 1.7rem; line-height: 1.25; margin: .2em 0 .4em; }
h2 { font-size: 1.25rem; margin: 1.4em 0 .5em; }
h3 { font-size: 1.08rem; margin: 1.3em 0 .4em; }
p { margin: .65em 0; }
a { color: var(--rose); }
.muted { color: var(--ink-soft); font-size: .92em; }
.small { font-size: .86em; }

/* ---- Topbar ---- */
.topbar { background: var(--maroon); position: sticky; top: 0; z-index: 40; box-shadow: 0 1px 8px rgba(0,0,0,.18); }
.topbar-inner { max-width: 1060px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 600; font-size: 1.06rem; padding: 13px 0; }
.brand-mark { color: #e9b8cc; }
.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: #f2dbe7; text-decoration: none; padding: 14px 11px; font-size: .93rem; border-bottom: 3px solid transparent; }
.nav a:hover { color: #fff; }
.nav a.active { color: #fff; border-bottom-color: var(--gold); }
.nav a.nav-sos { color: #ffd9a8; font-weight: 700; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; color: #fff; font-size: 1.5rem; padding: 10px; cursor: pointer; }
@media (max-width: 840px) {
  .nav-toggle { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; padding-bottom: 8px; }
  body.nav-open .nav { display: flex; }
  .nav a { padding: 11px 6px; border-bottom: 1px solid rgba(255,255,255,.08); }
  .nav a.active { border-bottom-color: var(--gold); }
}

/* ---- Layout ---- */
.wrap { max-width: 1060px; margin: 0 auto; padding: 22px 16px 60px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.footer { text-align: center; padding: 26px 18px 40px; color: var(--ink-soft); font-size: .85rem; border-top: 1px solid var(--line); background: #fff; }
.footer p { margin: .25em 0; }
.footer-note { max-width: 640px; margin: .25em auto; }

/* ---- Flash & badge ---- */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; }
.flash-ok { background: #e5f3ea; color: #21603d; border: 1px solid #bfe0cc; }
.flash-err { background: #fbe6e4; color: #8f2d24; border: 1px solid #efc4bf; }
.badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: #fff; }

/* ---- Forms ---- */
label { display: block; font-weight: 700; margin: 14px 0 5px; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], textarea, select {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 11px;
  font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose-soft); }
.btn {
  display: inline-block; background: var(--maroon); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 26px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { background: var(--maroon-deep); }
.btn-soft { background: var(--rose-soft); color: var(--maroon); }
.btn-soft:hover { background: #ecd2dd; }
.btn-line { background: none; border: 1.5px solid var(--maroon); color: var(--maroon); }
.btn-danger { background: var(--danger); }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 7px 16px; font-size: .88rem; }

/* ---- Auth pages ---- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: linear-gradient(160deg, var(--maroon-deep), var(--maroon) 55%, var(--rose)); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 34px 30px; box-shadow: 0 18px 50px rgba(0,0,0,.3); }
.auth-brand { text-align: center; margin-bottom: 8px; }
.auth-brand h1 { margin: 0; font-size: 1.55rem; }
.auth-brand p { margin: 4px 0 0; color: var(--ink-soft); font-size: .92rem; }

/* ---- Dashboard ---- */
.hero { background: linear-gradient(140deg, var(--maroon-deep), var(--maroon) 70%, var(--rose)); color: #fff;
  border-radius: var(--radius); padding: 26px 24px; margin-bottom: 18px; }
.hero h1 { color: #fff; margin: 0 0 6px; }
.hero .quote { font-family: 'Lora', serif; font-style: italic; opacity: .92; margin-top: 12px; border-left: 3px solid var(--gold); padding-left: 12px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 0; }
.stat { background: rgba(255,255,255,.12); border-radius: 12px; padding: 12px 8px; text-align: center; }
.stat b { display: block; font-size: 1.45rem; font-family: 'Lora', serif; }
.stat span { font-size: .78rem; opacity: .9; }
.tool-card { display: block; text-decoration: none; color: inherit; transition: transform .12s; }
.tool-card:hover { transform: translateY(-2px); }
.tool-card .tool-ico { font-size: 1.5rem; }
.tool-card h3 { margin: 6px 0 4px; }
.next-step { border-left: 4px solid var(--gold); }

/* ---- Checklist ---- */
.chk-item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.chk-item:last-child { border-bottom: 0; }
.chk-title { font-weight: 800; }
.seg { display: flex; gap: 8px; margin-top: 9px; }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 9px 4px; border: 1.5px solid var(--line); border-radius: 10px;
  cursor: pointer; font-size: .84rem; font-weight: 700; color: var(--ink-soft); background: #fff; }
.seg input:checked + span { border-color: var(--maroon); background: var(--rose-soft); color: var(--maroon); }
.zone-box { border-radius: 14px; padding: 18px 20px; color: #fff; margin: 14px 0; }
.score-big { font-family: 'Lora', serif; font-size: 2.4rem; font-weight: 700; line-height: 1; }
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding: 10px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 34px; }
.bar { width: 100%; max-width: 46px; border-radius: 8px 8px 0 0; min-height: 6px; }
.bar-label { font-size: .72rem; color: var(--ink-soft); text-align: center; }

/* ---- Scripts ---- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 15px; font: inherit;
  font-size: .87rem; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.chip.active { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.script-card { margin-bottom: 14px; }
.script-sit { font-weight: 800; color: var(--maroon); }
.script-quote { font-family: 'Lora', serif; font-size: 1.04rem; background: var(--rose-soft); border-left: 4px solid var(--rose);
  border-radius: 0 12px 12px 0; padding: 13px 16px; margin: 10px 0; }
.script-note { font-size: .9rem; color: var(--ink-soft); }
.copy-btn { float: right; }

/* ---- Jurnal ---- */
.day-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--rose-soft); color: var(--maroon);
  border-radius: 999px; padding: 5px 14px; font-weight: 800; font-size: .9rem; }
.mood-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mood-row label { margin: 0; }
.mood-row input { position: absolute; opacity: 0; }
.mood-row span { display: inline-block; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px;
  cursor: pointer; font-size: .87rem; font-weight: 700; color: var(--ink-soft); background: #fff; }
.mood-row input:checked + span { border-color: var(--maroon); background: var(--rose-soft); color: var(--maroon); }
.entry { border-left: 3px solid var(--rose-soft); padding: 4px 0 4px 14px; margin: 14px 0; }
.streak-dots { display: flex; gap: 5px; flex-wrap: wrap; margin: 10px 0; }
.dot { width: 22px; height: 22px; border-radius: 50%; background: #eee1e8; color: var(--ink-soft);
  font-size: .62rem; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.dot.done { background: var(--maroon); color: #fff; }
.dot.today { outline: 2px solid var(--gold); outline-offset: 1px; }

/* ---- Darurat ---- */
.sos-hero { background: linear-gradient(150deg, #3d1728, var(--maroon-deep)); color: #fff; border-radius: var(--radius);
  padding: 26px 24px; margin-bottom: 18px; text-align: center; }
.sos-hero h1 { color: #fff; }
.timer-display { font-family: 'Lora', serif; font-size: 3.2rem; font-weight: 700; letter-spacing: 2px; margin: 8px 0; }
.breath-circle { width: 130px; height: 130px; margin: 18px auto; border-radius: 50%; background: var(--rose-soft);
  display: flex; align-items: center; justify-content: center; color: var(--maroon); font-weight: 800;
  transition: transform 4s ease-in-out; }
.breath-circle.in { transform: scale(1.45); }

/* ---- Ebook ---- */
.ebook-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
.ebook-body p { margin: .9em 0; }
.ebook-body h3 { color: var(--maroon); margin-top: 1.6em; }
.toc a { display: block; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px;
  text-decoration: none; color: var(--ink); background: #fff; font-weight: 700; }
.toc a:hover { border-color: var(--rose); }
.toc .toc-done { color: var(--ink-soft); }
.related-box { background: var(--rose-soft); border-radius: 12px; padding: 14px 18px; margin-top: 20px; }
.related-box h3 { margin: 0 0 6px; }
.related-box a { display: block; margin: 4px 0; font-weight: 700; }

/* ---- Peta ---- */
.peta-bars { margin: 14px 0; }
.peta-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.peta-name { width: 170px; font-size: .88rem; font-weight: 700; }
.peta-track { flex: 1; background: #f0e6ec; border-radius: 999px; height: 14px; overflow: hidden; }
.peta-fill { height: 100%; border-radius: 999px; background: var(--rose); }
.peta-max .peta-fill { background: var(--danger); }
.peta-val { width: 34px; text-align: right; font-weight: 800; font-size: .88rem; }

/* ---- Tabel admin ---- */
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--ink-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.code-tag { font-family: monospace; background: var(--rose-soft); padding: 3px 9px; border-radius: 7px; font-weight: 700; }

@media print { .topbar, .footer, .btn, .nav { display: none !important; } body { background: #fff; } }

/* ---- Gembok premium & modal ---- */
.nav a.js-locked { opacity: .82; }
.lock-card { text-align: center; padding: 40px 24px; }
.lock-ico { font-size: 3rem; margin-bottom: 6px; }
.tool-lock { position: absolute; top: 12px; right: 14px; font-size: 1.05rem; }
.tool-card { position: relative; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(40, 12, 27, .62); display: flex;
  align-items: center; justify-content: center; z-index: 90; padding: 18px; }
.modal-backdrop[hidden] { display: none; }
.modal-card { position: relative; background: #fff; border-radius: 20px; max-width: 380px; width: 100%;
  padding: 30px 26px; text-align: center; box-shadow: 0 22px 60px rgba(0,0,0,.4); animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-ico { font-size: 2.6rem; }
.modal-card h2 { margin: 6px 0 0; }
.modal-price { font-family: 'Lora', serif; font-size: 1.9rem; font-weight: 700; color: var(--maroon); margin: 2px 0 8px; }
.modal-close { position: absolute; top: 8px; right: 14px; background: none; border: 0; font-size: 1.7rem;
  color: var(--ink-soft); cursor: pointer; }
.badge-premium { background: var(--gold); }
