﻿/* गृहपाठ – member UI (Phase 3). Self-contained; no Bootstrap/AdminLTE on member pages. */
:root {
  --green: #1b5e20; --green-2: #2e7d32; --green-soft: #e8f5e9;
  --saffron: #ef6c00; --saffron-soft: #fff3e0;
  --bg: #faf9f6; --card: #ffffff; --text: #222; --muted: #6b6b6b; --line: #e6e3dc;
  --radius: 14px; --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.05);
  --nav-h: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Mukta', 'Noto Sans Devanagari', 'Nirmala UI', 'Mangal', 'Segoe UI', sans-serif;
  font-size: 17px; line-height: 1.55;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
body.no-nav { padding-bottom: 16px; }
a { color: var(--green); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.3; font-weight: 700; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .center { text-align: center; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--green); color: #fff;
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: 56px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.topbar .back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 4px 14px 4px 10px; border-radius: 999px; background: #fff; color: var(--green); font-weight: 700; font-size: 1rem; line-height: 1; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.topbar .back .chev { font-size: 1.6rem; line-height: 1; margin-top: -3px; }
.topbar .back:active { background: var(--green-soft); }
.topbar .logo { height: 36px; width: 36px; border-radius: 50%; background: #fff; object-fit: contain; }
.topbar .title { flex: 1; font-weight: 700; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .who { display: flex; align-items: center; gap: 6px; max-width: 44%; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 3px 10px 3px 5px; font-size: .82rem; }
.topbar .who svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.topbar .who .who-t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.topbar .who small { font-size: .62rem; opacity: .85; white-space: nowrap; }
.topbar .who .n { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blessing { text-align: center; font-size: .85rem; color: var(--muted); padding: 6px 0 0; }

/* page */
.page { max-width: 720px; margin: 0 auto; padding: 12px 16px 24px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0 8px; }
.section-title h2 { margin: 0; }

/* cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; border-left: 6px solid var(--green); }
.card.tap { cursor: pointer; transition: transform .08s, box-shadow .08s; }
.card.tap:active { transform: scale(.99); }
.card.locked { border-left-color: #b9b9b9; background: #f4f3f0; color: #7a7a7a; }
.card.done { border-left-color: #43a047; }
.card.next { border-left-color: var(--saffron); background: #fffdf8; }
.card.continue { border-left-color: var(--saffron); background: var(--saffron-soft); }
.card h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.card h3 a { color: inherit; }
.card .author { color: var(--muted); font-size: .92rem; margin-bottom: 4px; }
.card .desc { font-size: .9rem; color: #444; margin-bottom: 6px; }
.card .meta { display: flex; justify-content: space-between; align-items: center; font-size: .88rem; color: var(--muted); margin-top: 6px; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); white-space: nowrap; }
.badge.done { background: #c8e6c9; color: #1b5e20; }
.badge.lock { background: #e0e0e0; color: #555; }
.badge.next { background: var(--saffron-soft); color: var(--saffron); }
.num { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 700; font-size: .95rem; flex: none; }
.locked .num { background: #e0e0e0; color: #777; }
.done .num { background: #43a047; color: #fff; }
.next .num { background: var(--saffron); color: #fff; }

/* progress */
.bar { height: 8px; background: #e9e7e1; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; background: var(--green-2); border-radius: 4px; }
.bar.warm > span { background: var(--saffron); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 2px solid var(--green); background: var(--green); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.btn.outline { background: #fff; color: var(--green); }
.btn.warm { background: var(--saffron); border-color: var(--saffron); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.sm { min-height: 38px; padding: 6px 14px; font-size: .92rem; }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.stat .v { font-size: 1.6rem; font-weight: 700; color: var(--green); line-height: 1.2; }
.stat .l { font-size: .85rem; color: var(--muted); }

/* notices */
.notice { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: .95rem; }
.notice.info { background: var(--green-soft); border-color: #c8e6c9; }
.notice.warn { background: var(--saffron-soft); border-color: #ffe0b2; }

/* compact book list (home, माहिती) */
.booklist { list-style: none; counter-reset: bk; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.booklist li { counter-increment: bk; display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 8px; padding: 8px 12px 8px 10px; border-bottom: 1px solid var(--line); font-size: .95rem; line-height: 1.35; }
.booklist li:last-child { border-bottom: 0; }
.booklist li::before { content: counter(bk, devanagari) "."; grid-row: 1 / span 2; color: var(--green); font-weight: 700; text-align: right; }
.booklist .t { font-weight: 600; color: var(--text); }
.booklist .a { font-size: .82rem; color: var(--muted); }

/* माहिती page navigation buttons */
.navlist { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 6px; }
.navbtn { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px; border-radius: var(--radius); background: var(--green-soft); border: 2px solid #c8e6c9; color: var(--green); font-weight: 700; font-size: 1.05rem; }
.navbtn:active { background: #d7ecd9; }
.navbtn .ic { font-size: 1.5rem; line-height: 1; flex: none; }
.navbtn .lbl { flex: 1; }
.navbtn .chev { font-size: 1.8rem; line-height: 1; color: var(--green-2); flex: none; }

/* माहिती section menu (top and bottom of each section page) */
.infonav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.infonav a, .infonav .cur { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 46px; padding: 6px 10px; border-radius: 12px; font-size: .9rem; font-weight: 600; line-height: 1.2; background: #fff; border: 2px solid #c8e6c9; color: var(--green); }
.infonav .cur { background: var(--saffron); border-color: var(--saffron); color: #fff; }
.infonav .all { grid-column: 1 / -1; min-height: 38px; background: var(--green-soft); }
article + .infonav, .booklist + .infonav { margin-top: 14px; }

/* bottom nav */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; align-items: stretch;
}
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .78rem; font-weight: 600; }
.bottomnav a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bottomnav a.active { color: var(--green); }
.bottomnav a.active::after { content: ""; position: absolute; top: 0; width: 40px; height: 3px; background: var(--green); border-radius: 0 0 3px 3px; }
.bottomnav a { position: relative; }

/* forms (request / public pages) */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.input, input[type=text], input[type=tel], input[type=email], input[type=number], input[type=password], textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #cfcbc2; border-radius: 10px; background: #fff; }
.input:focus, input:focus, textarea:focus { outline: 2px solid var(--green-2); border-color: var(--green-2); }
.err { color: #c62828; font-size: .9rem; }
.ok { color: var(--green); }
.hero { text-align: center; padding: 18px 0 6px; }
.hero img { height: 84px; }
article { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
article h2 { margin-top: 1.1em; font-size: 1.15rem; color: var(--green); }
article ul, article ol { padding-left: 1.3em; }

/* player */
.player-wrap { background: #000; margin: 0 -16px; }
.player-box { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.player-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.player-box .shield { position: absolute; inset: 0; }
.watermark { position: absolute; left: 4%; top: 8%; color: rgba(255,255,255,.55); font-size: .85rem; font-weight: 600; text-shadow: 0 0 4px rgba(0,0,0,.6); pointer-events: none; white-space: nowrap; transition: left 1.5s ease, top 1.5s ease; }
.controls { background: #fff; border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); padding: 10px 12px 12px; }
.controls .main { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 4px 0 8px; }
.cbtn { font: inherit; border: 0; background: var(--green-soft); color: var(--green); border-radius: 50%; width: 56px; height: 56px; font-size: 1.1rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.cbtn.big { width: 72px; height: 72px; background: var(--green); color: #fff; font-size: 1.6rem; }
.cbtn.small { width: 44px; height: 44px; font-size: .95rem; background: #f1efe9; color: #444; }
.cbtn.skip { width: auto; min-width: 72px; padding: 0 14px; border-radius: 999px; white-space: nowrap; font-size: 1rem; }
.controls .times { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); }
.controls .times b { color: var(--green); font-size: 1rem; }
.controls .extra { display: flex; justify-content: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
input[type=range].seek { width: 100%; height: 28px; margin: 4px 0; -webkit-appearance: none; background: transparent; }
input[type=range].seek::-webkit-slider-runnable-track { height: 8px; background: #e0ddd5; border-radius: 4px; }
input[type=range].seek::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--green); margin-top: -8px; border: 3px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
input[type=range].seek::-moz-range-track { height: 8px; background: #e0ddd5; border-radius: 4px; }
input[type=range].seek::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--green); border: 3px solid #fff; }
body.fs .player-wrap { position: fixed; inset: 0; margin: 0; z-index: 100; background: #000; }
body.fs .player-box { position: absolute; inset: 0; aspect-ratio: auto; }
body.fs .controls { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,.85)); border-radius: 0; padding: 6px 12px calc(8px + env(safe-area-inset-bottom)); color: #fff; transition: opacity .3s; }
body.fs.hide-controls .controls { opacity: 0; pointer-events: none; }
body.fs .bar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
body.fs .controls .times { flex-direction: column; font-size: .75rem; color: #ddd; min-width: 54px; }
body.fs .controls .times b { color: #fff; font-size: .9rem; }
body.fs .controls .main { margin: 0; gap: 10px; }
body.fs .controls .extra { margin: 0; gap: 6px; }
body.fs .cbtn { width: 44px; height: 44px; font-size: .9rem; background: rgba(255,255,255,.18); color: #fff; }
body.fs .cbtn.big { width: 56px; height: 56px; font-size: 1.3rem; background: var(--green); }
body.fs .cbtn.skip { min-width: 62px; padding: 0 10px; font-size: .9rem; }
body.fs .cbtn.small { width: 38px; height: 38px; font-size: .85rem; }
body.fs .cbtn.zoom { display: none; }
body.fs input[type=range].seek { height: 22px; margin: 0; }
.disclaimer { font-size: .8rem; color: var(--muted); text-align: center; margin-top: 16px; }

@media (min-width: 600px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .player-wrap { margin: 0; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
}
