/* Tokens tomados del sistema Modernist (design_handoff_romina_garino_app/design/_ds/...) */
:root {
  --bg: #201e1d;
  --ink: #f3f2f2;
  --accent: #ff563c;
  --accent-600: #dd2b0f;
  --divider-2: rgba(243,242,242,.35);
  --divider-1: rgba(243,242,242,.2);
  --surface: rgba(243,242,242,.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Archivo, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

h1 {
  font-weight: 800;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: -.015em;
  margin: 8px 0 6px;
}

.kicker {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.sub { font-size: 13px; opacity: .75; margin: 0 0 24px; }

/* ── Login / onboarding ── */
.onboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px;
}
.onboard-head { padding: 24px 0 8px; }
.step { flex: 1; padding-top: 24px; }

.input {
  width: 100%;
  min-height: 48px;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--divider-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 18px;
  padding: 8px 0;
}
.input:focus { outline: none; border-color: var(--accent); }
.input-code {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: .3em;
  text-align: center;
}

.error {
  color: var(--accent);
  font-size: 12.5px;
  min-height: 18px;
  margin: 8px 0 0;
}

.onboard-foot {
  display: flex;
  gap: 12px;
  padding-top: 16px;
}

.btn-primary, .btn-secondary {
  min-height: 48px;
  border: none;
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  padding: 0 20px;
  cursor: pointer;
}
.btn-primary {
  flex: 1;
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:active { background: var(--accent-600); }
.btn-primary:disabled { opacity: .45; cursor: default; }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--divider-2);
}
.btn-full { width: 100%; flex: none; }

/* ── Tab bar ── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 2px solid var(--divider-2);
  background: var(--bg);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab {
  display: flex; align-items: center; justify-content: center;
  min-height: 52px;
  font-family: Archivo, sans-serif; font-weight: 600; font-size: 10px;
  letter-spacing: .06em; text-transform: uppercase;
  color: rgba(243,242,242,.6);
  border-top: 3px solid transparent;
  text-decoration: none;
}
.tab.active { color: var(--accent); border-top-color: var(--accent); }

/* ── App / plan ── */
.app-body { padding-bottom: 96px; }
.app-header {
  padding: 24px 18px 16px;
  border-bottom: 2px solid var(--divider-2);
}
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.link-ghost {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(243,242,242,.6); text-decoration: none;
}
.link-ghost:hover { color: var(--ink); }
.app-main { padding: 0 0 24px; }

.block-head {
  background: var(--surface);
  font-weight: 800;
  font-size: 13px;
  padding: 11px 18px;
}

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--divider-1);
}
.item-check {
  width: 24px;
  height: 24px;
  flex: none;
  border: 1.5px solid rgba(243,242,242,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
}
.item-check.done {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.item-body { flex: 1; }
.item-name { font-weight: 600; font-size: 14.5px; }
.item.done .item-name { text-decoration: line-through; opacity: .6; }
.item-note { font-size: 11.5px; opacity: .6; }
.item-sets { font-weight: 800; font-size: 15px; white-space: nowrap; }

.section-label {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .6;
  padding: 16px 18px 8px;
  margin: 0;
}

.sensation { padding: 0 18px; }
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border: 1px solid var(--divider-2);
}
.segmented button {
  min-height: 44px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--divider-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.segmented button:last-child { border-right: none; }
.segmented button.active { background: var(--accent); color: var(--bg); }

.app-foot {
  padding: 24px 18px 0;
  border-top: none;
}

.toast {
  position: fixed;
  left: 18px; right: 18px; bottom: 90px;
  background: var(--ink);
  color: var(--bg);
  padding: 14px 16px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 50;
}
.toast[hidden] { display: none; }
.toast::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--accent);
  flex: none;
}

/* ── Progreso ── */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding: 8px 18px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar { width: 100%; min-height: 3px; background: rgba(243,242,242,.3); }
.bar.is-current { background: var(--accent); }
.bar-label { font-size: 9.5px; opacity: .5; }

.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 2px solid var(--divider-2); border-bottom: 2px solid var(--divider-2);
  margin-top: 16px;
}
.stat-cell { padding: 16px 18px; border-right: 1px solid var(--divider-1); }
.stat-cell:nth-child(even) { border-right: none; }
.stat-cell .kicker { color: rgba(243,242,242,.55); margin-bottom: 6px; }
.stat-cell strong { display: block; font-family: Archivo, sans-serif; font-weight: 800; font-size: 22px; }

.history-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--divider-1);
}
.history-date { width: 46px; flex: none; font-size: 12px; opacity: .5; text-transform: capitalize; }
.history-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.history-title { font-weight: 600; font-size: 14px; }
.history-meta { font-size: 11.5px; opacity: .55; }
.history-rpe { font-weight: 800; font-size: 13px; flex: none; }
.history-rpe.is-hard { color: var(--accent); }

/* ── Mi plan ── */
.plan-summary-box { padding: 0 18px; }
.plan-box-title { margin: 6px 0; font-family: Archivo, sans-serif; font-weight: 800; font-size: 19px; }
.hr { height: 2px; background: var(--divider-2); margin: 14px 0; border: none; }
.plan-box-block {
  display: flex; justify-content: space-between; align-items: center; font-size: 13px;
  padding: 8px 0; border-bottom: 1px solid var(--divider-1);
}
.plan-box-block.is-next { font-weight: 600; }
.plan-box-block .tag { margin-left: 8px; padding: 3px 8px; }
.sub-inline { opacity: .55; flex: none; }

.cuota-box { margin: 24px 18px 0; padding: 18px; border: 2px solid var(--divider-2); }
.cuota-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
#cuota-amount { font-family: Archivo, sans-serif; font-weight: 800; font-size: 26px; }
.tag {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 5px 10px; border: 1px solid transparent;
}
.tag-neutral { border-color: var(--divider-2); color: var(--ink); }
.tag-outline { border-color: var(--accent); color: var(--accent); }
.tag-accent { background: var(--accent); color: var(--bg); }
#cuota-due { font-size: 12px; opacity: .65; margin: 0 0 16px; }
.cuota-box .btn-secondary { margin-top: 10px; }

/* ── Chat ── */
.chat-thread { padding: 16px 18px 150px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.bubble-row { display: flex; }
.bubble-row.is-own { justify-content: flex-end; }
.bubble { max-width: 82%; padding: 9px 12px; background: var(--surface); border: 1px solid var(--divider-1); }
.bubble-row.is-own .bubble { background: #ec3013; border-color: #ec3013; }
.bubble-meta { margin: 0 0 3px; font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; opacity: .6; }
.bubble-text { margin: 0; font-size: 13.5px; line-height: 1.5; }

.chat-send {
  position: fixed; left: 0; right: 0; bottom: 78px; z-index: 30;
  display: flex; gap: 10px; padding: 12px 18px;
  border-top: 2px solid var(--divider-2); background: var(--bg);
}
.chat-send .input { border: 1px solid var(--divider-2); border-bottom: 1px solid var(--divider-2); padding: 10px 12px; font-size: 14px; min-height: 44px; }
.chat-send .btn-primary { flex: none; padding: 0 18px; }
