/*
 * theme.css — WRITTEN BY THE PLATFORM. Do not edit.
 *
 * Palette: Your colours (custom)
 * Source colours: #0c1816 #111111 #ffffff #55aa9c #242eb7
 *
 * Every value below is either one of those five or derived from them, and each
 * one is contrast-corrected against this palette's own background. Consume
 * them with var(--token); never write a colour value in app code.
 */

:root {
  --canvas: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f3f3;
  --border: #dedede;
  --border-strong: #b8b8b8;
  --ink: #111111;
  --muted: #707070;
  --accent: #55aa9c;
  --accent-hover: #489185;
  --accent-ink: #111111;
  --accent-text: #242eb7;
  --accent-strong: #386f66;
  --accent-soft: #e7f3f1;
  --accent-border: #b3d9d2;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #e3f0e8;
  --success-strong: #137638;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #f6eae1;
  --warning-strong: #a64c08;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #f7e4e4;
  --danger-strong: #b91c1c;}

/* ====================================================================
 * FitTrack — app.css
 *
 * Character: confident, energetic, athletic. Slightly tighter radius than
 * the default, a bit more room between sections, and every accent-heavy
 * surface built from color-mix() on top of the owner's theme tokens — never
 * a literal color.
 * ==================================================================== */

:root {
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --s-6: 1.75rem;
  --shadow-raised: 0 12px 32px -12px color-mix(in srgb, var(--ink) 28%, transparent);
}

/* ---------- Auth screens ------------------------------------------- */

.auth-wrap {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--s-10, 3rem);
  align-items: center;
  min-height: calc(100vh - 8rem);
  max-width: 980px;
  margin: 0 auto;
  padding: var(--s-8, 2rem) 0;
}
.auth-hero {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-strong)));
  color: var(--accent-ink);
  border-radius: var(--radius-lg);
  padding: var(--s-10, 3rem) var(--s-8, 2.25rem);
  box-shadow: var(--shadow-raised);
}
.auth-hero .brand-mark {
  background: color-mix(in srgb, var(--accent-ink) 18%, transparent);
  color: var(--accent-ink);
}
.auth-hero h1 { font-size: var(--t-4xl, 2.25rem); letter-spacing: -0.02em; }
.auth-hero ul { list-style: none; padding: 0; }
.auth-hero ul li { padding: .25rem 0; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-8, 2.25rem);
  box-shadow: var(--shadow);
}
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; min-height: auto; }
  .auth-hero { padding: var(--s-6); }
}

/* ---------- Dashboard hero ------------------------------------------ */

.dash-hero {
  border-radius: var(--radius-lg);
  padding: var(--s-8, 2.25rem);
  background: radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.dash-hero h1 { font-size: var(--t-3xl, 1.85rem); letter-spacing: -0.01em; }

/* ---------- Stat cards ----------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--s-4, 1rem);
}
.stat-tile {
  transition: transform var(--dur-2, .2s) var(--ease, ease), box-shadow var(--dur-2, .2s) var(--ease, ease);
}
.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-raised); }
.stat-emoji { font-size: 1.25rem; line-height: 1; }
.stat-value { font-size: var(--t-2xl, 1.6rem); font-weight: 650; letter-spacing: -0.01em; }

/* ---------- Progress rings -------------------------------------------- */

.ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ring svg { transform: rotate(-90deg); }
.ring-fill { transition: stroke-dashoffset .7s var(--ease, ease); }
.ring-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; line-height: 1.1;
}
.ring-label strong { font-size: var(--t-lg, 1.05rem); font-weight: 700; }
.ring-label span { font-size: var(--t-xs, .72rem); color: var(--muted); }
.goal-rings {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-6, 1.75rem);
  justify-content: space-around;
}

/* ---------- Week bars --------------------------------------------------- */

.week-bars { display: flex; align-items: flex-end; height: 96px; }
.week-bars > * + * { margin-left: .5rem; }
.week-bar { display: flex; flex-direction: column; align-items: center; gap: .35rem; flex: 1; height: 100%; }
.week-bar-track {
  width: 100%; max-width: 22px; height: 72px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--border) 70%, transparent);
  display: flex; align-items: flex-end; overflow: hidden;
}
.week-bar-fill {
  width: 100%; border-radius: var(--radius-pill);
  background: linear-gradient(0deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--accent-strong)));
}

/* ---------- Meals ------------------------------------------------------ */

.meal-thumb { width: 44px; height: 44px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--border); }

/* ---------- AI Food Scanner --------------------------------------------- */

.scan-drop {
  border: 1.5px dashed var(--accent-border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  padding: var(--s-8, 2rem);
  text-align: center;
}
.scan-result-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--s-6, 1.75rem);
  align-items: start;
}
.scan-photo {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
}
@media (max-width: 640px) {
  .scan-result-grid { grid-template-columns: 1fr; }
  .scan-photo { max-width: 260px; margin: 0 auto; }
}

/* ---------- AI Trainer chat ---------------------------------------------- */

.chat-card { display: flex; flex-direction: column; overflow: hidden; }
.chat-thread {
  display: flex; flex-direction: column;
  padding: var(--s-6, 1.5rem); min-height: 360px; max-height: 56vh; overflow-y: auto;
}
.chat-thread > * + * { margin-top: var(--s-4, 1rem); }
.chat-row { display: flex; align-items: flex-start; gap: .6rem; max-width: 80%; }
.chat-row-user { align-self: flex-end; flex-direction: row-reverse; max-width: 80%; }
.chat-avatar {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent-strong);
  display: flex; align-items: center; justify-content: center;
}
.chat-bubble { padding: .65rem .9rem; border-radius: var(--radius); font-size: var(--t-sm); line-height: 1.5; white-space: pre-wrap; }
.chat-bubble-assistant { background: var(--surface-2); border: 1px solid var(--border); border-top-left-radius: 4px; }
.chat-bubble-user { background: var(--accent); color: var(--accent-ink); border-top-right-radius: 4px; }
.chat-composer {
  display: flex; gap: .6rem; padding: var(--s-4, 1rem);
  border-top: 1px solid var(--border); background: var(--surface);
}
.chat-composer .input { flex: 1; }

/* ---------- Misc -------------------------------------------------------- */

.menu-label { padding: .4rem .9rem; font-size: var(--t-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

@media (max-width: 480px) {
  .dash-hero, .auth-card, .auth-hero { padding: var(--s-5, 1.25rem); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
