/* FitDocMed Daily Streak — shared styles
   Palette: pine ink, sage growth green, muted gold milestones, stone background
   Type: Outfit (headlines/numerals) + Inter (everything else) — clean, modern */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #16281F;
  --ink-soft: #56675C;
  --stone: #F4F5F0;
  --stone-card: #FFFFFF;
  --line: #E4E6DD;
  --pine: #3C7A56;
  --pine-deep: #2A5A3E;
  --pine-soft: #E6F0E9;
  --gold: #C0923A;
  --gold-soft: #FBF1DF;
  --clay: #B0553C;
  --shadow: 0 1px 2px rgba(22, 40, 31, 0.05), 0 10px 28px rgba(22, 40, 31, 0.07);
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, .numeral {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

a { color: var(--pine-deep); }

.wrap {
  max-width: 430px;
  margin: 0 auto;
  padding: 28px 20px 56px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Entrance animation --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.enter { animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }
.enter-1 { animation-delay: 0.02s; }
.enter-2 { animation-delay: 0.10s; }
.enter-3 { animation-delay: 0.18s; }
.enter-4 { animation-delay: 0.26s; }
.enter-5 { animation-delay: 0.34s; }

/* --- Brand mark --- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--pine) 0%, var(--pine-deep) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-mark img { width: 100%; height: 100%; object-fit: cover; }

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.15;
}

.brand-tag {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 1px;
}

/* --- Cards / forms --- */
.card {
  background: var(--stone-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.stack { display: flex; flex-direction: column; gap: 14px; }

.field label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-weight: 500;
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(60, 122, 86, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border-radius: 10px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--pine-deep); color: #fff; }
.btn-primary:hover { background: var(--pine); box-shadow: 0 6px 16px rgba(42, 90, 62, 0.25); }
.btn-primary:disabled { background: #A9BEB1; cursor: not-allowed; box-shadow: none; }

.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

.hint {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.msg {
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 9px;
  display: none;
}

.msg.show { display: block; animation: fadeUp 0.3s ease both; }
.msg.error { background: #F7E6E1; color: #8A3F2C; }
.msg.success { background: var(--pine-soft); color: var(--pine-deep); }

.switch-line {
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 18px;
}

.switch-line a { font-weight: 600; text-decoration: none; }

.foot-note {
  margin-top: 22px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* --- Dashboard --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.logout-link {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: 20px;
  transition: border-color 0.15s ease;
}
.logout-link:hover { border-color: var(--pine); color: var(--pine-deep); }

.greeting { font-size: 15px; color: var(--ink-soft); margin-bottom: 2px; }

.stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 20px;
}

.chip-target { color: var(--pine-deep); background: var(--pine-soft); }
.chip-longest { color: var(--gold); background: var(--gold-soft); }

.progress-line {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-top: 10px;
  line-height: 1.5;
}
.progress-line strong { color: var(--ink); font-weight: 600; }

.streak-card {
  text-align: center;
  padding: 30px 24px 26px;
  margin-top: 16px;
}

.streak-number {
  font-size: 64px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--pine-deep), var(--pine));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: transform 0.25s ease;
}

.streak-number.bump { animation: numberBump 0.4s ease; }
@keyframes numberBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.streak-label {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 6px;
  letter-spacing: 0.01em;
}

.mark-btn { margin-top: 22px; }

.mark-btn.marked {
  background: var(--pine-deep);
  opacity: 0.55;
  cursor: default;
}
.mark-btn.marked:hover { background: var(--pine-deep); box-shadow: none; }

.compliment {
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--pine-deep);
  background: var(--pine-soft);
  border-radius: 10px;
  padding: 10px 14px;
  line-height: 1.5;
  animation: fadeUp 0.4s ease both;
}

.reset-banner {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--clay);
}

@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.pop { animation: pop 0.35s ease; }

/* --- Month grid --- */
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 26px 0 10px;
}

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

.day-cell {
  aspect-ratio: 1;
  border-radius: 7px;
  background: var(--stone);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--ink-soft);
  transition: transform 0.2s ease;
}

.day-cell.marked {
  background: linear-gradient(155deg, var(--pine) 0%, var(--pine-deep) 100%);
  border-color: var(--pine-deep);
  color: #fff;
  font-weight: 600;
}

.day-cell.today { box-shadow: 0 0 0 2px var(--gold) inset; }
.day-cell.future { opacity: 0.4; }
.day-cell.pop-in { animation: dayPop 0.35s ease both; }
@keyframes dayPop {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

/* --- Milestone tree --- */
.tree-wrap {
  margin-top: 8px;
  background: var(--stone-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 8px 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tree-wrap svg { display: block; width: 100%; height: auto; }

.tree-path-bg { fill: none; stroke: var(--line); stroke-width: 4; stroke-linecap: round; }

.tree-path-fill {
  fill: none;
  stroke: url(#growthGradient);
  stroke-width: 4.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.node-circle {
  stroke-width: 2.5;
  transition: fill 0.4s ease, stroke 0.4s ease;
}

.node-circle.locked { fill: var(--stone-card); stroke: var(--line); }
.node-circle.unlocked { fill: var(--gold); stroke: var(--gold); }
.node-circle.unlocked.current { fill: url(#currentGradient); stroke: var(--pine-deep); }

.node-group { opacity: 0; animation: nodeIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes nodeIn {
  from { opacity: 0; transform: scale(0.3); }
  to { opacity: 1; transform: scale(1); }
}
.node-group.locked-group { animation: fadeUp 0.5s ease both; }

.pulse-ring {
  fill: none;
  stroke: var(--pine);
  stroke-width: 2;
  transform-origin: center;
  animation: pulseRing 2.2s ease-out infinite;
}
@keyframes pulseRing {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.9); opacity: 0; }
}

.node-icon { fill: #fff; pointer-events: none; }
.node-label {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  fill: var(--ink-soft);
}
.node-label.unlocked { fill: var(--ink); font-weight: 600; }
.node-days {
  font-family: 'Inter', sans-serif;
  font-size: 9.5px;
  fill: var(--ink-soft);
}

.longest-note {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 6px;
  padding-bottom: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .pop, .node-group, .day-cell.pop-in, .streak-number.bump, .pulse-ring, .enter {
    animation: none !important;
  }
  .tree-path-fill { transition: none; }
}
