/* ── Reset & base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:      #3d7a4f;
  --green-light:#6aab7d;
  --green-pale: #e8f5ec;
  --red-pale:   #fde8e8;
  --red:        #c0392b;
  --bg:         #f4f7f5;
  --card:       #ffffff;
  --text:       #1a2a1f;
  --muted:      #6b7c72;
  --radius:     16px;
  --shadow:     0 4px 24px rgba(0,0,0,.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Landing ──────────────────────────────────────────────────────── */
.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a3a26 0%, #2d6644 50%, #3d7a4f 100%);
}

.landing-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.matcha-icon { font-size: 4rem; margin-bottom: 1rem; }

.landing-card h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: .75rem;
}

.landing-card p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: .85rem 2rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, opacity .15s;
}

.btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--green);
  color: #fff;
}

.btn-yes {
  background: var(--green);
  color: #fff;
  font-size: 1.2rem;
  padding: 1rem 2.5rem;
}

.btn-no {
  background: #f0f0f0;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 1rem 2rem;
}

.btn-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* ── Navbar ───────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.5rem;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--green);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
}

.nav-link:hover { color: var(--green); }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: none;
}

/* ── Check-in page ────────────────────────────────────────────────── */
.checkin-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 2rem 1rem;
}

.checkin-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow);
}

.today-label {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: .75rem;
}

.question {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: .5rem;
}

.matcha-word {
  color: var(--green);
}

.checkin-status {
  margin: 1.2rem 0 .5rem;
  min-height: 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.status-yes  { color: var(--green); }
.status-no   { color: var(--red); }

/* Streak */
.streak-box {
  margin-top: 2rem;
  padding: 1rem 1.5rem;
  background: var(--green-pale);
  border-radius: 12px;
  font-size: .95rem;
  color: var(--green);
  font-weight: 600;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Analytics page ───────────────────────────────────────────────── */
.analytics-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.analytics-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 1.5rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card.highlight {
  background: var(--green);
  color: #fff;
}

.stat-num {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .4rem;
  opacity: .75;
}

/* ── Calendar ─────────────────────────────────────────────────────── */
.calendar-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.cal-month {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.cal-month-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-dow {
  text-align: center;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  padding: .3rem 0;
}

.cal-day {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 600;
  cursor: default;
}

.cal-day.empty        { background: transparent; }
.cal-day.future       { background: #f5f5f5; color: #ccc; }
.cal-day.before-start { background: transparent; color: #ddd; }
.cal-day.no-data      { background: var(--red-pale); color: var(--red); }
.cal-day.drank        { background: var(--green); color: #fff; }
.cal-day.skipped      { background: var(--red-pale); color: var(--red); }
.cal-day.today        { outline: 2px solid var(--green-light); outline-offset: 2px; }
.cal-day.editable     { cursor: pointer; }
.cal-day.editable:hover { filter: brightness(1.1); transform: scale(1.08); transition: transform .1s; }

/* ── Edit modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity .15s;
}
.modal-overlay.visible { opacity: 1; }

.modal-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.modal-title {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: .5rem;
}

.modal-question {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.modal-btns {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.modal-btn {
  width: 100%;
  padding: .8rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .1s, box-shadow .1s;
}
.modal-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.modal-btn.btn-yes   { background: var(--green); color: #fff; }
.modal-btn.btn-no    { background: var(--red-pale); color: var(--red); }
.modal-btn.btn-clear { background: #f0f0f0; color: var(--muted); font-size: .9rem; }
.modal-btn.active    { border-color: currentColor; box-shadow: inset 0 0 0 2px rgba(0,0,0,.15); }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .question { font-size: 1.5rem; }
  .checkin-card { padding: 2rem 1.25rem; }
  .landing-card { padding: 2rem 1.25rem; }
}
