/* ============================================================
   আমলনামা — Maisha's Daily Tracker
   Design tokens: parchment paper, deep pine, antique gold,
   khatim (8-point star) motif as the signature element.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Noto+Serif+Bengali:wght@500;700&family=Work+Sans:wght@400;500;600&family=Hind+Siliguri:wght@400;500;600&display=swap');

:root {
  --paper: #F6F1E4;
  --paper-card: #FFFDF7;
  --ink: #23302B;
  --ink-soft: #56635C;
  --pine: #163832;
  --pine-light: #1F4C43;
  --gold: #B4872B;
  --gold-soft: #E4C983;
  --gold-tint: #F3E6C4;
  --rose: #9C4A3E;
  --line: rgba(22, 56, 50, 0.14);
  --radius: 14px;
  --shadow: 0 6px 24px rgba(22, 56, 50, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Hind Siliguri', 'Work Sans', sans-serif;
  line-height: 1.6;
  background-image:
    radial-gradient(circle at 10% 8%, rgba(180,135,43,0.06), transparent 40%),
    radial-gradient(circle at 90% 92%, rgba(22,56,50,0.05), transparent 40%);
}

.wrap { max-width: 760px; margin: 0 auto; padding: 32px 20px 80px; }

/* ---------- Khatim (8-point star) motif, used sparingly ---------- */
.khatim {
  width: 34px; height: 34px; margin: 0 auto;
  display: block;
}
.khatim path { fill: var(--gold); }

.divider {
  display: flex; align-items: center; gap: 14px;
  margin: 40px 0 28px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

/* ---------- Header ---------- */
.hero {
  text-align: center;
  padding: 12px 0 8px;
}
.hero .eyebrow {
  font-family: 'Work Sans', sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
}
.hero h1 {
  font-family: 'Noto Serif Bengali', 'Amiri', serif;
  font-size: 40px;
  margin: 10px 0 6px;
  color: var(--pine);
}
.hero .sub {
  font-family: 'Amiri', serif;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 16px;
  max-width: 520px;
  margin: 0 auto;
}

/* ---------- Motivational plaque ---------- */
.plaque {
  background: var(--pine);
  color: var(--gold-tint);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin: 28px 0;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.plaque::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(228,201,131,0.14) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: 0.5;
}
.plaque .quote {
  position: relative;
  font-family: 'Noto Serif Bengali', serif;
  font-size: 19px;
  line-height: 1.8;
  margin: 0 0 8px;
}
.plaque .who {
  position: relative;
  font-family: 'Work Sans', sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gold-soft);
  text-transform: uppercase;
}

/* ---------- Cards / categories ---------- */
.card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-family: 'Noto Serif Bengali', serif;
  font-size: 20px;
  color: var(--pine);
  margin: 0 0 4px;
  display: flex; align-items: center; justify-content: space-between;
}
.card h2 .pts {
  font-family: 'Work Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  background: var(--gold-tint);
  padding: 3px 10px;
  border-radius: 999px;
}
.card .hint {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.check-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.check-row:last-child { border-bottom: none; }
.check-row label { font-size: 15px; }
.check-row input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: var(--pine);
}

.field-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 0;
}
.field-row input[type="number"] {
  width: 90px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: 'Work Sans', sans-serif;
  font-size: 15px;
  background: var(--paper);
  color: var(--ink);
}
.field-row input[type="number"]:focus {
  outline: 2px solid var(--gold-soft);
  outline-offset: 1px;
}

/* ---------- Submit ---------- */
.submit-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--pine);
  color: var(--gold-tint);
  font-family: 'Noto Serif Bengali', serif;
  font-size: 18px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s ease;
}
.submit-btn:hover { background: var(--pine-light); }
.submit-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.link-row { text-align: center; margin-top: 26px; }
.link-row a {
  color: var(--pine);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
}

/* ---------- Score badge (result / history) ---------- */
.score-badge {
  width: 150px; height: 150px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--pct, 0) * 1%), var(--gold-tint) 0);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}
.score-badge .inner {
  width: 118px; height: 118px;
  border-radius: 50%;
  background: var(--pine);
  color: var(--gold-tint);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: 'Noto Serif Bengali', serif;
}
.score-badge .inner .num { font-size: 30px; font-weight: 700; }
.score-badge .inner .lbl { font-size: 11px; letter-spacing: 0.06em; }

/* ---------- History table ---------- */
table.history {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table.history th, table.history td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
table.history th {
  background: var(--pine);
  color: var(--gold-tint);
  font-family: 'Work Sans', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
table.history tr:last-child td { border-bottom: none; }
.pct-good { color: var(--pine); font-weight: 600; }
.pct-mid  { color: var(--gold); font-weight: 600; }
.pct-low  { color: var(--rose); font-weight: 600; }

.bar-track {
  background: var(--gold-tint);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-top: 4px;
}
.bar-fill {
  background: var(--pine);
  height: 100%;
}

@media (max-width: 480px) {
  .hero h1 { font-size: 30px; }
  .card { padding: 18px; }
}
