/* ===== AHORA — estilos. Dos temas via variables. Minimalista para no distraer (TDAH). ===== */
:root {
  --r: 16px;
  --r-sm: 11px;
  --gap: 16px;
  --tap: 52px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* TEMA CALMA (claro) */
[data-theme="light"] {
  --bg: #f4f3f0;
  --bg2: #ffffff;
  --card: #ffffff;
  --text: #232026;
  --muted: #8a8694;
  --line: #e7e4df;
  --accent: #6c5ce7;
  --accent2: #00b8a9;
  --accent-soft: #efecff;
  --done: #2bb673;
  --shadow: 0 4px 20px rgba(40,30,60,.07);
  --warn: #e8915b;
}
/* TEMA QUIMERA (oscuro Data Drift: negro + purpura + cyan) */
[data-theme="dark"] {
  --bg: #0a0a10;
  --bg2: #12121d;
  --card: #161624;
  --text: #ECEAF6;
  --muted: #8b87a6;
  --line: #262339;
  --accent: #8b5cf6;
  --accent2: #22d3ee;
  --accent-soft: #1d1733;
  --done: #2dd4a7;
  --shadow: 0 6px 28px rgba(0,0,0,.45);
  --warn: #f0a868;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  overscroll-behavior: none;
  transition: background .3s, color .3s;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.error { color: #e0506a; font-size: 13px; }
h1 { font-size: 28px; margin: 8px 0; }
h2 { font-size: 22px; margin: 0; }

/* ===== screens centradas (pin / onboarding) ===== */
.screen.center { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; box-shadow: var(--shadow); width: 100%; }
.card.narrow { max-width: 380px; text-align: center; }
.logo-dot { width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 6px;
  background: radial-gradient(circle at 35% 30%, var(--accent2), var(--accent)); box-shadow: 0 0 22px var(--accent); }
.field-label { display: block; text-align: left; font-size: 13px; color: var(--muted); margin: 14px 0 5px; }

.text-input, .pin {
  width: 100%; height: var(--tap); padding: 0 16px; margin-bottom: 10px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--bg2);
  color: var(--text); font-size: 16px; outline: none; transition: border-color .15s;
}
.text-input.small { height: 42px; max-width: 200px; }
.text-input:focus, .pin:focus { border-color: var(--accent); }
.pin { text-align: center; letter-spacing: 12px; font-size: 26px; }

/* ===== botones ===== */
.btn { border: none; border-radius: var(--r-sm); padding: 0 18px; height: 46px; font-size: 15px; font-weight: 600;
  cursor: pointer; background: var(--bg2); color: var(--text); border: 1.5px solid var(--line); transition: transform .08s, filter .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.done { background: var(--done); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.big { height: 54px; font-size: 17px; width: 100%; margin-top: 8px; }
.btn.small { height: 38px; font-size: 13px; padding: 0 14px; }
.btn.full { width: 100%; margin-top: 10px; }

/* ===== layout app ===== */
#app { max-width: 620px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); padding-top: calc(12px + env(safe-area-inset-top)); }
.view-head { display: flex; justify-content: space-between; align-items: flex-start; margin: 18px 4px 14px; }
.streak { background: var(--accent-soft); color: var(--accent); padding: 6px 12px; border-radius: 30px; font-weight: 700; font-size: 14px; }

/* captura */
.capture-bar { position: sticky; top: 0; z-index: 30; display: flex; gap: 8px; padding: 12px 0 8px;
  background: linear-gradient(var(--bg) 75%, transparent); }
.capture-input { flex: 1; height: 50px; padding: 0 16px; border-radius: 30px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--text); font-size: 15px; outline: none; box-shadow: var(--shadow); }
.capture-input:focus { border-color: var(--accent); }
.capture-go { width: 50px; height: 50px; border-radius: 50%; border: none; background: var(--accent); color: #fff;
  font-size: 26px; cursor: pointer; box-shadow: 0 4px 14px rgba(108,92,231,.4); }
.capture-go:active { transform: scale(.92); }

/* progreso */
.progress-wrap { display: flex; align-items: center; gap: 10px; margin: 4px 4px 18px; }
.progress-track { flex: 1; height: 8px; background: var(--line); border-radius: 8px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .5s cubic-bezier(.2,.8,.2,1); }

/* lista de tareas */
.task-list { display: flex; flex-direction: column; gap: 12px; }
.task {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); animation: pop .25s ease; cursor: pointer;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.task.removing { animation: leave .4s forwards; }
@keyframes leave { to { opacity: 0; transform: translateX(40px) scale(.9); height: 0; padding: 0; margin: 0; } }
.task .check { width: 28px; height: 28px; min-width: 28px; border-radius: 50%; border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center; transition: all .15s; color: transparent; }
.task .check:hover { border-color: var(--done); }
.task.done .check { background: var(--done); border-color: var(--done); color: #fff; }
.task .body { flex: 1; min-width: 0; }
.task .text { font-size: 16px; font-weight: 500; word-break: break-word; }
.task.done .text { text-decoration: line-through; color: var(--muted); }
.task .meta { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.task .grip { color: var(--muted); font-size: 13px; }
.task .focus-btn { background: var(--accent-soft); color: var(--accent); border: none; border-radius: 8px; padding: 8px 12px; font-weight: 600; font-size: 13px; cursor: pointer; }

/* acciones inbox */
.task .to-today { background: var(--accent); color:#fff; border:none; border-radius: 8px; padding: 8px 12px; font-weight:600; font-size:13px; cursor:pointer; }
.task .to-today.full { background: var(--line); color: var(--muted); }

.empty { text-align: center; padding: 40px 20px; color: var(--text); }
.badge { background: var(--accent); color: #fff; border-radius: 20px; font-size: 11px; padding: 1px 7px; position: absolute; top: 6px; right: 18px; }

/* ===== tabbar ===== */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line); padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); }
.tab { position: relative; flex: 1; background: none; border: none; color: var(--muted); font-size: 11px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px; }
.tab .ic { font-size: 20px; }
.tab.active { color: var(--accent); }

/* ===== ajustes ===== */
.settings-list { display: flex; flex-direction: column; gap: 16px; margin-top: 10px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; }
.setting-row.column { }
.seg { display: flex; gap: 6px; }
.seg-btn { border: 1.5px solid var(--line); background: var(--bg2); color: var(--text); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 13px; }
.seg-btn.active { background: var(--accent); color: #fff; border-color: transparent; }
.switch { position: relative; display: inline-block; width: 48px; height: 28px; }
.switch input { display: none; }
.slider { position: absolute; inset: 0; background: var(--line); border-radius: 30px; transition: .2s; cursor: pointer; }
.slider:before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--done); }
.switch input:checked + .slider:before { transform: translateX(20px); }

/* ===== FOCUS MODE ===== */
.focus { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px; text-align: center; gap: 14px; }
.focus-close { position: absolute; top: calc(16px + env(safe-area-inset-top)); right: 18px; background: none; border: none; color: var(--muted); font-size: 26px; cursor: pointer; }
.focus-label { letter-spacing: 3px; font-size: 11px; color: var(--accent); font-weight: 700; margin: 0; }
.focus-task { font-size: 24px; max-width: 480px; margin: 0; }
.focus-step { margin: 0; font-size: 15px; }
.timer-wrap { position: relative; width: min(72vw, 280px); aspect-ratio: 1; margin: 6px 0; }
.timer-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-bg { fill: none; stroke: var(--line); stroke-width: 14; }
.timer-arc { fill: none; stroke: var(--accent); stroke-width: 14; stroke-linecap: round;
  stroke-dasharray: 678.58; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear, stroke .3s; }
.timer-arc.warn { stroke: var(--warn); }
.timer-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
#timer-text { font-size: 46px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer-presets { display: flex; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--bg2); color: var(--text); border-radius: 30px; width: 52px; height: 38px; cursor: pointer; font-weight: 600; }
.chip.active { background: var(--accent); color: #fff; border-color: transparent; }
.focus-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%; max-width: 360px; }
.focus-actions .btn.big { width: auto; flex: 1; min-width: 120px; margin-top: 0; }
.focus-steps { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 360px; margin-top: 4px; }
.fstep { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; text-align: left; }
.fstep .fcheck { width: 20px; height: 20px; min-width:20px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.fstep.done .fcheck { background: var(--done); border-color: var(--done); }
.fstep.done span { text-decoration: line-through; color: var(--muted); }
.fstep-add { display: flex; gap: 8px; }
.fstep-add input { flex: 1; height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg2); color: var(--text); padding: 0 12px; outline: none; }

/* celebracion */
.confetti { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%) translateY(20px); z-index: 210;
  background: var(--accent); color: #fff; padding: 12px 22px; border-radius: 30px; font-weight: 700; opacity: 0;
  transition: all .3s; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 560px) { .task .grip { display: inline; } }
