@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations'),
       url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
}

:root {
  --bg: #FFFFFF;
  --text: #2F3437;
  --muted: #787774;
  --faint: #A5A29C;
  --border: #E9ECEF;
  --hover: #F7F7F5;
  --active: #EFEFED;
  --accent: #2383E2;
  --accent-hover: #0F6FCF;
  --ok: #448361;
  --danger: #D44C47;
  --shadow: 0 1px 2px rgba(15, 15, 15, 0.04);
  --shadow-lift: 0 8px 24px rgba(15, 15, 15, 0.08), 0 1px 3px rgba(15, 15, 15, 0.06);
  --radius: 6px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Botones e inputs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.btn:hover { background: var(--hover); }
.btn:active { background: var(--active); }
.btn:focus-visible, .input:focus-visible, .icon-btn:focus-visible { outline: 2px solid rgba(35, 131, 226, 0.35); outline-offset: 1px; }
.btn[disabled] { opacity: 0.55; cursor: default; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-dark { background: var(--text); border-color: var(--text); color: #fff; }
.btn-dark:hover { background: #1F2224; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-lg { height: 40px; padding: 0 16px; font-size: 15px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { background: var(--active); color: var(--text); }

.input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 14px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.input:focus { outline: none; border-color: #C9CFD4; box-shadow: 0 0 0 3px rgba(35, 131, 226, 0.12); }
.input::placeholder { color: var(--faint); }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--text);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
}

/* ---------- Compartido con la landing ---------- */
.link-btn {
  border: 0;
  padding: 0;
  background: none;
  color: var(--text);
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--faint);
  cursor: pointer;
}
.form-error { min-height: 18px; font-size: 13px; color: var(--danger); }

/* ---------- App ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar .spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: var(--active);
  color: var(--muted);
}
.badge.pro { background: #E7F3F8; color: #1F6C9F; }

/* Temporizador */
.timer {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.timer-modes { display: flex; }
.timer-mode {
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.timer-mode:hover { background: var(--hover); }
.timer-mode[aria-pressed='true'] { background: var(--active); color: var(--text); font-weight: 500; }
.timer-time {
  min-width: 52px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.timer.running .timer-time { color: var(--accent); }
.timer.done .timer-time { color: var(--ok); }

/* Tablero */
.board-wrap { padding: 28px 16px 64px; max-width: 1180px; margin: 0 auto; }
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.board-head h1 { font-size: 28px; }
.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.column { min-width: 0; }
.col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}
.col-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.column[data-col='enfoque'] .col-dot { background: var(--accent); }
.column[data-col='completado'] .col-dot { background: var(--ok); }
.col-count { color: var(--faint); font-weight: 400; font-size: 13px; }
.col-hint { margin-left: auto; color: var(--faint); font-weight: 400; font-size: 12px; }

.col-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 56px;
  padding: 4px;
  margin: 0 -4px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.col-list.drop-target { background: var(--hover); }

.card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 8px 6px 8px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow);
  font-size: 14px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.12s ease;
}
.card:hover { background: #FBFBFA; }
.column[data-col='completado'] .card-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }

.handle {
  flex: none;
  width: 18px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--faint);
  border-radius: 3px;
  cursor: grab;
  touch-action: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.card:hover .handle, .card:focus-within .handle { opacity: 1; }
.handle:hover { background: var(--active); color: var(--muted); }

.card-title {
  flex: 1;
  min-width: 0;
  padding: 1px 0;
  overflow-wrap: anywhere;
  cursor: text;
}
.card-edit {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  padding: 1px 0;
  font-size: 14px;
  background: transparent;
}
.card-del { opacity: 0; width: 22px; height: 22px; flex: none; }
.card:hover .card-del, .card:focus-within .card-del { opacity: 1; }

.card.placeholder { background: var(--hover); border-style: dashed; box-shadow: none; }
.card.placeholder > * { visibility: hidden; }
.card.ghost {
  position: fixed;
  z-index: 100;
  margin: 0;
  pointer-events: none;
  box-shadow: var(--shadow-lift);
  transform-origin: 30% 50%;
  cursor: grabbing;
  transition: none;
}
.card.ghost .handle { opacity: 1; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }
.card.settle { transition: transform 0.14s var(--ease); }

.add-task { margin-top: 4px; }
.add-btn {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--faint);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.add-btn:hover { background: var(--hover); color: var(--muted); }
.add-form .input { height: 34px; }

.empty-hint { padding: 10px 6px; font-size: 13px; color: var(--faint); }

/* Bóveda (panel lateral) */
.vault {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  width: min(380px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(15, 15, 15, 0.05);
  transform: translateX(100%);
  transition: transform 0.2s var(--ease), visibility 0s linear 0.2s;
  visibility: hidden;
}
.vault.open { transform: none; visibility: visible; transition: transform 0.2s var(--ease); }
.vault-head { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border); }
.vault-head h2 { font-size: 15px; font-weight: 600; flex: 1; }
.vault-body { flex: 1; overflow-y: auto; padding: 12px; }
.vault-intro { font-size: 13px; color: var(--muted); padding: 4px 4px 12px; }
.vault-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
}
.vault-item:hover { background: var(--hover); }
.vault-item .meta { flex: 1; min-width: 0; }
.vault-item b { display: block; font-size: 14px; font-weight: 500; }
.vault-item span { display: block; font-size: 13px; color: var(--muted); }
.vault-item .btn { height: 28px; padding: 0 10px; font-size: 13px; }
.lock { font-size: 12px; color: var(--faint); }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(15, 15, 15, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.scrim.show { opacity: 1; pointer-events: auto; }

/* Modal */
.modal-back {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 15, 15, 0.28);
  animation: fade 0.15s ease;
}
.modal {
  width: 100%;
  max-width: 420px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  box-shadow: 0 16px 48px rgba(15, 15, 15, 0.12);
  animation: pop 0.18s var(--ease);
}
.modal h2 { font-size: 20px; }
.modal p { margin-top: 8px; color: var(--muted); font-size: 14px; }
.modal ul { list-style: none; padding: 0; margin: 16px 0 20px; display: grid; gap: 8px; font-size: 14px; }
.modal li::before { content: '✓'; margin-right: 8px; color: var(--muted); }
.modal .fine { margin-top: 10px; text-align: center; font-size: 12px; color: var(--faint); }
.modal .row { display: flex; gap: 8px; margin-top: 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 80;
  max-width: calc(100vw - 32px);
  padding: 9px 14px;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow-lift);
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (hover: none) {
  .handle, .card-del { opacity: 1; }
}

@media (max-width: 760px) {
  .board { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .board-wrap { padding: 20px 16px 48px; }
  .board-head h1 { font-size: 24px; }
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .timer { order: 3; width: 100%; justify-content: space-between; }
  .topbar .spacer { display: none; }
  .topbar-actions { margin-left: auto; }
  .col-hint { display: none; }
}

@media (max-width: 560px) {
  .btn-label { display: none; }
}

.center { text-align: center; }
#checkout-error { margin-top: 8px; }
.ml-auto { margin-left: auto; }
.modal-wide { max-width: 640px; }
.reader-body { margin-top: 12px; max-height: 60vh; overflow-y: auto; font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.sr-copy { position: fixed; top: -1000px; left: 0; opacity: 0; }
.col-list:empty::before { content: 'Suelta aquí una tarjeta'; padding: 14px 6px; font-size: 13px; color: var(--faint); }
.vault-item .btn .lock { margin-right: 2px; font-size: 11px; font-weight: 600; }

/* Aviso de consentimiento (solo con Clarity activo) */
.consent {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 90;
  width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: var(--shadow-lift);
  font-size: 13px;
  line-height: 1.5;
  animation: pop 0.18s var(--ease);
}
.consent-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* Bóveda: buscador y categorías */
.vault-search { margin: 0 0 8px; }
.vault-cat {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 16px 10px 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.vault-cat span { font-weight: 400; color: var(--faint); }
.vault-empty { padding: 16px 10px; font-size: 13px; color: var(--faint); }
.vault-item .btn .lock.free { color: var(--ok); }
