/* =========================================================
   Roadmap Callface — clean light theme
   ========================================================= */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #14142b;
  --muted: #6b7280;
  --muted-2: #9aa1ad;
  --border: #e7e9ee;
  --border-2: #dde0e7;

  --brand: #e23752;       /* carmim Callface */
  --brand-soft: #fdecef;
  --purple: #7b2fa8;

  --s-todo: #94a3b8;
  --s-doing: #f59e0b;
  --s-done: #10b981;
  --s-blocked: #ef4444;

  --acc-red: #e23752;
  --acc-orange: #f97316;
  --acc-amber: #f59e0b;
  --acc-green: #10b981;

  --shadow: 0 1px 2px rgba(20,20,43,0.04), 0 4px 16px rgba(20,20,43,0.05);
  --shadow-lg: 0 8px 30px rgba(20,20,43,0.10);
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Botões ---------- */
.btn-primary { background: var(--brand); color: #fff; border: none; font-weight: 600; font-size: 15px; padding: 12px 20px; border-radius: 10px; transition: all .2s; }
.btn-primary:hover { background: #c92d46; }
.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--border-2); font-weight: 600; font-size: 14px; padding: 9px 18px; border-radius: 10px; transition: all .2s; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost.editing { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-ghost-sm { background: transparent; color: var(--muted); border: 1px dashed var(--border-2); font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: 9px; transition: all .2s; }
.btn-ghost-sm:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- Gate ---------- */
.gate { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(700px 500px at 50% 0%, #fff, var(--bg)); padding: 24px; }
.gate-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 40px 36px; width: 100%; max-width: 380px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.gate-logo { height: 30px; margin: 0 auto 8px; }
.gate-card h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.gate-card p { color: var(--muted); font-size: 0.92rem; margin-bottom: 8px; }
.gate-card input { border: 1px solid var(--border-2); border-radius: 10px; padding: 12px 14px; font-size: 15px; outline: none; transition: border .2s; }
.gate-card input:focus { border-color: var(--brand); }
.gate-error { color: var(--s-blocked); font-size: 0.85rem; min-height: 18px; }

/* ---------- Topbar ---------- */
.app { max-width: 1080px; margin: 0 auto; padding: 0 24px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 26px 0 18px; flex-wrap: wrap; gap: 14px; position: sticky; top: 0; background: linear-gradient(var(--bg) 70%, transparent); z-index: 10; }
.tb-left { display: flex; align-items: center; gap: 14px; }
.tb-logo { height: 26px; }
.tb-title h1 { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.tb-sub { font-size: 0.82rem; color: var(--muted); }
.tb-right { display: flex; align-items: center; gap: 14px; }
.updated { font-size: 0.78rem; color: var(--muted-2); }
.save-state { font-size: 0.8rem; color: var(--s-done); font-weight: 600; opacity: 0; transition: opacity .3s; }
.save-state.show { opacity: 1; }
.save-state.saving { color: var(--muted); }
.save-state.err { color: var(--s-blocked); }

/* ---------- Legend ---------- */
.legend { display: flex; gap: 18px; flex-wrap: wrap; padding: 6px 0 22px; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.lg { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.s-todo { background: var(--s-todo); }
.dot.s-doing { background: var(--s-doing); }
.dot.s-done { background: var(--s-done); }
.dot.s-blocked { background: var(--s-blocked); }

/* ---------- Board / groups ---------- */
.board { display: flex; flex-direction: column; gap: 34px; }
.group { }
.group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.group-bar { width: 4px; height: 22px; border-radius: 4px; flex-shrink: 0; }
.group-bar.red { background: var(--acc-red); }
.group-bar.orange { background: var(--acc-orange); }
.group-bar.amber { background: var(--acc-amber); }
.group-bar.green { background: var(--acc-green); }
.group-head h2 { font-size: 1.12rem; font-weight: 800; letter-spacing: -0.01em; }
.group-tag { font-size: 0.72rem; font-weight: 600; color: var(--muted); background: var(--bg); border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px; }
.group-del { margin-left: auto; }

.items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 760px) { .items { grid-template-columns: 1fr; } }

/* ---------- Item card ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); transition: box-shadow .2s, border-color .2s; position: relative; }
.card:hover { box-shadow: var(--shadow-lg); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.card-title { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; flex: 1; }
.card-goal { color: var(--muted); font-size: 0.86rem; margin-bottom: 14px; }

/* status pill */
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; user-select: none; }
.status-pill .dot { width: 7px; height: 7px; }
.status-pill.todo { background: #f1f5f9; color: #64748b; }
.status-pill.doing { background: #fef3c7; color: #b45309; }
.status-pill.done { background: #d1fae5; color: #047857; }
.status-pill.blocked { background: #fee2e2; color: #b91c1c; }
.editing-mode .status-pill { cursor: pointer; }
.editing-mode .status-pill:hover { filter: brightness(0.96); box-shadow: 0 0 0 2px rgba(226,55,82,0.15); }

/* owner badge */
.owner { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 8px; border-radius: 6px; }
.owner.scott { background: var(--brand-soft); color: var(--brand); }
.owner.claude { background: #f3e8ff; color: var(--purple); }
.owner.externo { background: #f1f5f9; color: #64748b; }

/* progress */
.progress { height: 5px; background: #eef0f4; border-radius: 999px; overflow: hidden; margin: 4px 0 14px; }
.progress > i { display: block; height: 100%; background: var(--s-done); border-radius: 999px; transition: width .3s; }

/* subtasks */
.subs { display: flex; flex-direction: column; gap: 9px; }
.sub { display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; }
.sub .chk { width: 17px; height: 17px; border: 1.5px solid var(--border-2); border-radius: 5px; flex-shrink: 0; margin-top: 1px; display: grid; place-items: center; cursor: pointer; transition: all .15s; background: #fff; }
.sub .chk:hover { border-color: var(--s-done); }
.sub .chk.on { background: var(--s-done); border-color: var(--s-done); }
.sub .chk.on::after { content: '✓'; color: #fff; font-size: 11px; font-weight: 800; line-height: 1; }
.sub .txt { color: var(--ink); flex: 1; }
.sub.on .txt { color: var(--muted-2); text-decoration: line-through; }
.sub-del { color: var(--muted-2); font-size: 14px; line-height: 1; background: none; border: none; padding: 0 4px; opacity: 0; transition: opacity .15s; }
.card:hover .sub-del { opacity: .6; }
.sub-del:hover { color: var(--s-blocked); opacity: 1; }

/* editable */
.editing-mode [contenteditable="true"] { outline: none; border-radius: 5px; transition: background .15s; }
.editing-mode [contenteditable="true"]:hover { background: #f8f9fb; }
.editing-mode [contenteditable="true"]:focus { background: #fff7f8; box-shadow: 0 0 0 2px rgba(226,55,82,0.18); }

.card-foot { display: flex; gap: 8px; margin-top: 14px; }
.add-sub, .item-del { font-size: 0.78rem; }
.item-del { margin-left: auto; color: var(--muted-2); background: none; border: none; }
.item-del:hover { color: var(--s-blocked); }

.add-item { width: 100%; margin-top: 4px; }
.edit-actions { margin-top: 28px; }

/* edit-only visibility */
.edit-only { display: none; }
.editing-mode .edit-only { display: inline-flex; }

/* foot */
.foot { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 0.78rem; margin-top: 46px; padding-top: 20px; border-top: 1px solid var(--border); }
.foot b { color: var(--ink); }

@media (max-width: 520px) {
  .app { padding: 0 16px 40px; }
  .tb-right { width: 100%; justify-content: space-between; }
}
