/* n8n Meetup Buenos Aires — estética del editor de n8n (colores de marca: #EA4B71, #040506, #FFFFFF) */
:root {
  --bg: #040506;
  --surface: #101116;
  --surface-2: #17181f;
  --line: #262833;
  --line-2: #343746;
  --text: #f5f5f7;
  --muted: #9b9caa;
  --pink: #EA4B71;
  --pink-hover: #f26a8b;
  --pink-soft: rgba(234, 75, 113, .14);
  --ok: #35c28a;
  --ok-soft: rgba(53, 194, 138, .14);
  --wait: #f2a83b;
  --wait-soft: rgba(242, 168, 59, .14);
  --no: #8d8e9c;
  --err: #ff6b6b;
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 16px/1.55 var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 22px 22px;
}
a { color: var(--pink); text-underline-offset: 2px; }
a:hover { color: var(--pink-hover); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--pink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 16px; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.req { color: var(--pink); }

/* ---------- estructura ---------- */
.topbar { border-bottom: 1px solid var(--line); background: rgba(4, 5, 6, .85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar-in form { margin: 0; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand-logo { height: 28px; width: auto; min-width: 104px; margin-right: 4px; }
.brand-logo + .brand-text { padding-left: 16px; margin-left: 4px; border-left: 1px solid var(--line-2); white-space: nowrap; }
@media (max-width: 420px) { .brand-logo + .brand-text .muted { display: none; } }
.nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .92rem; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 16px 48px; flex: 1; }
.footer { border-top: 1px solid var(--line); text-align: center; padding: 20px 16px 28px; font-size: .92rem; }
.footer p { margin: 4px 0; }
.narrow { max-width: 460px; margin: 0 auto; display: grid; gap: 20px; }
.narrow.wide { max-width: 720px; }
/* Las columnas se ajustan a los bloques visibles: uno ocupa todo el ancho, dos van a la par. */
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); margin: 20px 0; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 12px; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 800; }
.h2 { font-size: clamp(1.35rem, 3.5vw, 1.7rem); font-weight: 700; }
.h3 { font-size: 1.1rem; font-weight: 700; margin-top: 20px; }

/* ---------- nodos ---------- */
.node {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 0 20px;
}
.grid-2 .node, .narrow .node { margin: 0; }
.node::before, .node::after {
  content: "";
  position: absolute;
  top: 26px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--line-2);
}
.node::before { left: -6px; }
.node::after { right: -6px; }
.node-h {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
  color: var(--muted); margin: -4px 0 14px;
}
.node-icon {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--pink-soft); color: var(--pink); font-size: .8rem;
}

/* ---------- portada ---------- */
.hero { display: grid; gap: 28px; align-items: center; grid-template-columns: 1fr; padding: 12px 0 8px; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.5fr 1fr; } .hero.hero-solo { grid-template-columns: 1fr; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: .9rem; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; background: var(--surface); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 4px var(--pink-soft); }
.node-img { padding: 12px; justify-self: center; max-width: 320px; width: 100%; margin: 0; }
.node-img img { display: block; width: 100%; border-radius: 10px; aspect-ratio: 1; object-fit: cover; }

.meta { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; }
.meta li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; }
.meta-k { color: var(--muted); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
@media (max-width: 480px) { .meta li { grid-template-columns: 1fr; gap: 0; } }

.big { font-size: 2rem; margin: 0 0 10px; line-height: 1.1; }
.big strong { color: var(--pink); font-weight: 800; }
progress.bar { width: 100%; height: 10px; border: 0; border-radius: 999px; background: var(--surface-2); overflow: hidden; appearance: none; }
progress.bar::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
progress.bar::-webkit-progress-value { background: var(--pink); border-radius: 999px; }
progress.bar::-moz-progress-bar { background: var(--pink); border-radius: 999px; }

.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

.flow { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 18px; }
.flow li { position: relative; }
.flow li + li::before { content: ""; position: absolute; left: 22px; top: -18px; height: 18px; border-left: 2px solid var(--line-2); }
.flow-node { display: inline-block; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 14px; font-weight: 500; }
.flow li:first-child .flow-node { border-color: var(--pink); }

/* ---------- botones ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border-radius: 10px; border: 1px solid transparent;
  font: 600 .98rem var(--font); text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--pink); color: #fff; }
.btn-primary:hover { background: var(--pink-hover); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: var(--err); border-color: rgba(255, 107, 107, .4); }
.btn-danger:hover { background: rgba(255, 107, 107, .1); color: var(--err); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .88rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- formularios ---------- */
.form { display: grid; gap: 18px; margin-top: 18px; }
.row { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field legend, #phone-l { font-weight: 600; font-size: .94rem; }
.field legend { margin-bottom: 8px; padding: 0; }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=password], input[type=number],
input[type=datetime-local], input[type=search], select, textarea {
  width: 100%;
  min-height: 44px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
  font: 400 1rem var(--font);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-soft); }
input::placeholder, textarea::placeholder { color: #6c6d7a; }
.code-input { font-family: var(--mono); font-size: 1.6rem !important; letter-spacing: .5em; text-align: center; }
.hint { margin: 0; color: var(--muted); font-size: .84rem; }
.err { margin: 0; color: var(--err); font-size: .88rem; font-weight: 500; }
.phone { display: grid; grid-template-columns: minmax(0, 190px) 1fr; gap: 8px; }
@media (max-width: 420px) { .phone { grid-template-columns: 1fr; } }

.choices { display: grid; gap: 10px; }
.choices-2 { grid-template-columns: 1fr; }
@media (min-width: 520px) { .choices-2 { grid-template-columns: 1fr 1fr; } }
.choices-3 { grid-template-columns: repeat(3, 1fr); }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice > span {
  display: grid; gap: 2px;
  border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px;
  background: var(--bg); transition: border-color .15s, background .15s;
}
.choice small { color: var(--muted); }
.choice-sm > span { text-align: center; padding: 10px; }
.choice input:checked + span { border-color: var(--pink); background: var(--pink-soft); }
.choice input:focus-visible + span { outline: 2px solid var(--pink); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .94rem; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--pink); flex: none; }

.pw { position: relative; }
.pw input { padding-right: 52px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 36px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.pw-toggle:hover { color: var(--text); background: var(--surface-2); }
.pw-toggle svg { width: 20px; height: 20px; }

/* ---------- avisos y estados ---------- */
.alert { border-radius: 10px; padding: 12px 14px; margin: 12px 0; border: 1px solid; font-weight: 500; }
.alert-error { border-color: rgba(255, 107, 107, .4); background: rgba(255, 107, 107, .08); color: #ffb3b3; }
.alert-ok { border-color: rgba(53, 194, 138, .4); background: var(--ok-soft); color: #9ff0cc; }
.alert-warn { border-color: rgba(242, 168, 59, .4); background: var(--wait-soft); color: #ffd69a; }

.badge { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: .82rem; font-weight: 700; margin: 0 0 12px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-2); }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-wait { background: var(--wait-soft); color: var(--wait); border-color: transparent; }
.badge-no { color: var(--no); }
.status-confirmed { border-color: rgba(53, 194, 138, .45); }
.status-waitlisted { border-color: rgba(242, 168, 59, .45); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; }

/* ---------- admin ---------- */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 0 0 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-decoration: none; color: var(--text); display: block; }
a.stat:hover { border-color: var(--line-2); color: var(--text); }
.stat b { display: block; font-size: 1.8rem; line-height: 1.1; font-weight: 800; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat-accent { border-color: var(--pink); }
.stat-accent b { color: var(--pink); }
.stat-ok b { color: var(--ok); }
.stat-wait b { color: var(--wait); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 0 0 14px; }
.toolbar .field { min-width: 140px; flex: 1; }
.toolbar .field.grow { flex: 3; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.wrap-cell { white-space: normal; min-width: 180px; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
.pill { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pill-confirmed { background: var(--ok-soft); color: var(--ok); }
.pill-waitlisted { background: var(--wait-soft); color: var(--wait); }
.pill-declined { color: var(--no); }
.pill-locked { background: rgba(255, 107, 107, .12); color: var(--err); }
.list-plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.list-plain li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.split { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } .split-3 { grid-template-columns: repeat(3, 1fr); } }
.preview { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 14px; font-size: .92rem; max-height: 420px; overflow: auto; }
.inline-form { display: inline; margin: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
code, .mono { font-family: var(--mono); font-size: .9em; }
details summary { cursor: pointer; font-weight: 600; }

/* ---------- modal ---------- */
.modal {
  border: 0; padding: 0; background: transparent; color: var(--text);
  width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: visible;
}
.modal::backdrop { background: rgba(4, 5, 6, .72); backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in .16s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal[open] { animation: none; } }
.modal-card {
  position: relative; margin: 0;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.modal-card::before, .modal-card::after {
  content: ""; position: absolute; top: 34px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface-2); border: 2px solid var(--pink);
}
.modal-card::before { left: -6px; }
.modal-card::after { right: -6px; }
.modal-icon {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; margin-bottom: 14px;
  background: var(--pink-soft); color: var(--pink); font-weight: 800; font-size: 1.1rem;
}
.modal-danger .modal-icon { background: rgba(255, 107, 107, .14); color: var(--err); }
.modal-danger .modal-card::before, .modal-danger .modal-card::after { border-color: var(--err); }
.modal-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 8px; }
.modal-body { color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.btn-danger-solid { background: #d64545; color: #fff; }
.btn-danger-solid:hover { background: #e25a5a; color: #fff; }
@media (max-width: 420px) { .modal-actions .btn { flex: 1; } }

/* ---------- avisos del formulario ---------- */
.choices-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .choices-4 { grid-template-columns: repeat(4, 1fr); } }
.note {
  display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 0;
  border: 1px solid var(--line-2); border-left: 3px solid var(--pink);
  background: var(--pink-soft); border-radius: 10px; padding: 10px 12px; font-size: .94rem;
}
.note-icon { flex: none; }

/* ---------- diccionario de etiquetas ---------- */
.tags { margin: 8px 0 16px; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; background: var(--bg); }
.tags[open] summary { margin-bottom: 10px; }
.tags summary { color: var(--pink); }
.tags .table-wrap { background: var(--surface); }
.tags code { color: var(--pink); white-space: nowrap; }
.tag-example { margin-top: 12px; border-left: 3px solid var(--pink); padding: 4px 0 4px 12px; }
.tag-example p { margin: 4px 0; }
.split > *, .grid-2 > * { min-width: 0; }
.tags th, .tags td { white-space: normal; }
.tags td:first-child { white-space: nowrap; }
.tags td.wrap-cell { min-width: 120px; overflow-wrap: anywhere; }

/* ---------- asistencia ---------- */
.attend { border-color: var(--pink); }
.attend-ok { border-color: rgba(53, 194, 138, .55); }
.attend-form { margin-top: 8px; }
.code-3 { letter-spacing: .6em; }
.attend-admin { border-color: var(--pink); }
.attend-admin-grid { display: grid; gap: 16px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 760px) { .attend-admin-grid { grid-template-columns: auto 1fr; } .attend-admin-grid .actions { justify-content: flex-end; } }
.attend-code { font-size: 3rem; font-weight: 700; letter-spacing: .25em; margin: 4px 0; color: var(--text); }

/* ---------- link personal ---------- */
.readonly-field { margin: 0; min-height: 44px; display: flex; align-items: center; padding: 10px 12px;
  border: 1px dashed var(--line-2); border-radius: 10px; color: var(--muted); font-family: var(--mono); }
.form-group { display: grid; gap: 18px; }

/* ---------- portada configurable ---------- */
.checks { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .checks { grid-template-columns: 1fr 1fr; } }
.confirm-number { display: inline-block; margin: 0 0 8px; padding: 6px 12px; border-radius: 10px;
  background: var(--ok-soft); color: #9ff0cc; font-weight: 500; }
.confirm-number strong { color: #fff; font-weight: 800; }

/* ---------- autoguardado ---------- */
.autosave-status { text-align: center; }
.draft-card { border-style: dashed; }

/* ---------- mensajes de la consola ---------- */
.flash { position: relative; padding-right: 44px; transition: opacity .3s; }
.fade-out { opacity: 0; }
[data-progress] { transition: opacity .3s; }
.flash-close {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent;
  color: inherit; cursor: pointer; font-size: 14px; opacity: .7;
}
.flash-close:hover { opacity: 1; background: rgba(255, 255, 255, .08); }

/* ---------- firma ---------- */
.sig-pad { display: block; width: 100%; height: 200px; background: #ffffff; border-radius: 10px;
  border: 2px dashed var(--line-2); touch-action: none; cursor: crosshair; }
.sig-current { background: #ffffff; border-radius: 10px; padding: 16px; display: grid; place-items: center; min-height: 120px; }
.sig-current img { max-width: 100%; max-height: 160px; }
