/* ============================================================
   Tokens
   ============================================================ */
:root{
  --bg: #14171A;
  --surface: #1C2024;
  --surface-2: #242930;
  --border: #2D3239;
  --text: #F1EEE8;
  --text-muted: #8D9298;
  --accent: #FF5A1F;
  --accent-ink: #2A0D00;
  --done: #34D399;
  --b1: #5B8DEF;
  --b2: #FFB23F;
  --b3: #B084F5;
  --b4: #34D399;
  --radius: 10px;
  --radius-lg: 16px;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

@media (prefers-color-scheme: light){
  :root{ /* mantenemos el tema oscuro intencionalmente en ambos modos */ }
}

*{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a{ color: inherit; text-decoration: none; }
h1,h2{ font-family: var(--font-display); margin: 0 0 .25rem; letter-spacing: -0.01em; }
h1{ font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 700; }
h2.block__title{ font-size: 1.05rem; font-weight: 700; }
p{ margin: 0; }
.muted{ color: var(--text-muted); }
.accent{ color: var(--accent); }

:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   Layout shell
   ============================================================ */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  position: sticky; top:0; background: rgba(20,23,26,.92); backdrop-filter: blur(6px);
  z-index: 20;
}
.brand{ display:flex; align-items:center; gap:10px; font-family: var(--font-display); font-weight:700; }
.brand-mark{
  width:18px; height:18px; border-radius:50%;
  background: conic-gradient(var(--accent) 0 270deg, var(--surface-2) 270deg 360deg);
  box-shadow: inset 0 0 0 3px var(--bg);
}
.brand-mark--lg{ width:40px; height:40px; margin: 0 auto 10px; }
.topnav{ display:flex; gap:16px; font-size:.92rem; color: var(--text-muted); }
.topnav a:hover{ color: var(--text); }

.container{ max-width: 720px; margin: 0 auto; padding: 18px 16px 90px; }
.footer{
  text-align:center; color: var(--text-muted); font-size:.8rem;
  padding: 18px; border-top: 1px solid var(--border);
}

.flash-stack{ margin-bottom: 14px; display:flex; flex-direction:column; gap:8px; }
.flash{ padding:10px 14px; border-radius: var(--radius); font-size:.9rem; }
.flash-success{ background: rgba(52,211,153,.12); color: var(--done); border:1px solid rgba(52,211,153,.35); }

/* ============================================================
   Hero / progress signature
   ============================================================ */
.hero{ padding: 6px 0 22px; }
.eyebrow{
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing:.08em;
  font-size:.72rem; color: var(--accent); margin-bottom: 6px;
}
.hero-sub{ color: var(--text-muted); margin-top:8px; max-width: 46ch; }

.bar-progress{ margin-top: 22px; }
.bar-progress__rail{ display:none; }
.bar-progress__plates{
  display:flex; flex-wrap:wrap; gap:6px;
}
.plate{
  width: 26px; height: 26px; border-radius:50%;
  border: 2px solid var(--border);
  display:flex; align-items:center; justify-content:center;
  font-family: var(--font-mono); font-size:.62rem; color: var(--text-muted);
  background: var(--surface);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.plate:hover{ transform: translateY(-2px); border-color: var(--accent); }
.plate--done{
  background: var(--done); border-color: var(--done); color: #042b1d; font-weight:700;
}
.plate__num{ pointer-events:none; }
.bar-caption{ margin-top: 10px; font-size:.85rem; color: var(--text-muted); }
.bar-caption strong{ color: var(--text); font-family: var(--font-mono); }

/* ============================================================
   Day list (index)
   ============================================================ */
.day-list{ display:flex; flex-direction:column; gap:8px; }
.day-row{
  display:grid; grid-template-columns: 38px 1fr auto; align-items:center; gap:14px;
  padding: 12px 14px; border:1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.day-row:hover{ border-color: var(--accent); }
.day-row__num{ font-family: var(--font-mono); color: var(--text-muted); font-size:.95rem; }
.day-row__body{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.day-row__title{ font-weight:600; }
.day-row__tag{ font-size:.8rem; color: var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.day-row__status{ display:flex; align-items:center; gap:6px; font-size:.78rem; color: var(--text-muted); white-space:nowrap; }
.status-dot{ width:8px; height:8px; border-radius:50%; background: var(--border); display:inline-block; }
.status-dot--done{ background: var(--done); }
.day-row--done .day-row__title{ color: var(--done); }

/* ============================================================
   Auth screen
   ============================================================ */
.auth-screen{ min-height: 60vh; display:flex; align-items:center; justify-content:center; }
.auth-card{
  max-width: 360px; width:100%; text-align:center;
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px 24px;
}
.auth-error{ color: #FF8C7A; font-size:.85rem; margin: 10px 0 0; }
.auth-form{ margin-top: 18px; display:flex; flex-direction:column; gap:10px; text-align:left; }

/* ============================================================
   Day detail
   ============================================================ */
.day-nav{
  display:grid; grid-template-columns: 1fr auto 1fr; align-items:center; gap:8px;
  font-size:.85rem; margin-bottom: 18px;
}
.day-nav__link{ color: var(--text-muted); }
.day-nav__link:hover{ color: var(--accent); }
.day-nav__home{ text-align:center; font-family: var(--font-mono); font-size:.75rem; color: var(--text-muted); letter-spacing:.05em; text-transform:uppercase; }
.day-nav__link:last-child{ text-align:right; }

.day-head{ padding-bottom: 18px; border-bottom: 1px dashed var(--border); margin-bottom: 18px; }
.day-meta{ display:flex; flex-wrap:wrap; gap:16px; align-items:center; margin: 16px 0 12px; }

.block{
  border-left: 3px solid var(--border);
  padding: 4px 0 4px 16px; margin-bottom: 26px;
}
.block--b1{ border-left-color: var(--b1); }
.block--b2{ border-left-color: var(--b2); }
.block--b3{ border-left-color: var(--b3); }
.block--b4{ border-left-color: var(--b4); }
.block__title{ display:flex; align-items:center; gap:8px; margin-bottom: 12px; }
.badge{
  font-family: var(--font-mono); font-size:.65rem; text-transform:uppercase; letter-spacing:.04em;
  padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted);
}
.badge--peso{ color: var(--accent); background: rgba(255,90,31,.12); }

.exercise{
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px;
}
.exercise__head{ display:flex; flex-direction:column; gap:8px; }
.exercise__name{ font-weight:600; }
.exercise__note-sys{ font-size:.78rem; color: var(--text-muted); font-style:italic; margin-top:6px; }

.tag-row{ display:flex; flex-wrap:wrap; gap:6px; }
.tag{
  font-family: var(--font-mono); font-size:.68rem; color: var(--text-muted);
  background: var(--surface-2); border-radius:999px; padding: 3px 9px;
}
.tag--reps{ color: var(--accent); }

.weight-grid{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; margin-top:12px; }

/* ============================================================
   Form elements
   ============================================================ */
.field{ display:flex; flex-direction:column; gap:5px; font-size:.82rem; color: var(--text-muted); flex:1; }
.field--note{ margin-top: 10px; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], textarea{
  font-family: var(--font-body); font-size: 1rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 12px; width:100%;
}
.field--num input{ font-family: var(--font-mono); font-weight:600; }
textarea{ resize: vertical; font-family: var(--font-body); }
input:focus, textarea:focus{ border-color: var(--accent); }

.check{ display:flex; align-items:center; gap:10px; cursor:pointer; }
.check input[type="checkbox"]{
  width:20px; height:20px; accent-color: var(--accent); flex-shrink:0;
}
.check--lg{ font-size:.95rem; color: var(--text); }

.btn{
  font-family: var(--font-display); font-weight:700; font-size:1rem;
  border-radius: var(--radius); padding: 14px 20px; border:1px solid transparent; cursor:pointer;
}
.btn-primary{ background: var(--accent); color:#1a0700; }
.btn-primary:hover{ filter: brightness(1.08); }
.btn-block{ width:100%; }

.save-bar{
  position: sticky; bottom: 14px; padding-top: 10px;
}

.settings-form{ display:flex; flex-direction:column; gap:14px; max-width: 420px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (min-width: 600px){
  .day-meta{ gap:24px; }
  .weight-grid{ max-width: 360px; }
}
