/* OpenGuidde — sistema de diseño "menos IA" (rediseño Claude Design de Angel):
   plano, sin degradados, acento índigo sólido, tipografía Onest, tarjetas de 16px
   y sombras muy suaves. */
@import url('/static/fonts/onest.css');

:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --ink: #17171c;
  --mut: #6c6c77;
  --mut-2: #8b8b95;
  --mut-3: #9c9ca6;
  --mut-4: #a6a6b0;
  --line: #ececef;
  --line-2: #e2e2e7;
  --accent: #5546e3;
  --accent-2: #e6497f;
  --accent-soft: #eeedfc;
  --accent-soft-2: #f4f2fe;
  --accent-soft-line: #d6cffb;
  --ok: #17915e;
  --ok-bg: #e6f5ee;
  --warn: #a16207;
  --warn-bg: #fbf3e0;
  --err: #d64545;
  --err-bg: #fdf2f2;
  --err-line: #f3d0d0;
  --sidebar: #141419;
  --sidebar-hover: #26262e;
  --radius: 16px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(17, 17, 26, 0.03);
  --shadow-hover: 0 8px 24px rgba(17, 17, 26, 0.09);
  --focus: 0 0 0 3px rgba(85, 70, 227, 0.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Onest', system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: #463ac4; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 12px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
textarea { resize: vertical; min-height: 74px; line-height: 1.5; }
::placeholder { color: #a6a6b0; }
::selection { background: #ded9fb; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 72px; flex: 0 0 72px; background: var(--sidebar); display: flex; flex-direction: column;
  align-items: center; padding: 18px 0; gap: 6px; position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { width: 40px; height: 40px; margin-bottom: 14px; border-radius: 11px; }
.sidebar a.nav {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  color: #6b6b78; transition: background .15s, color .15s;
}
.sidebar a.nav:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar a.nav.active { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(85, 70, 227, 0.4); }
.sidebar .spacer { flex: 1; }
.sidebar .avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 600; font-size: 14px; cursor: pointer;
}
.main { flex: 1; min-width: 0; overflow-x: hidden; padding: 34px 40px 60px; max-width: 1320px; }
.topbar { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 26px; }
.topbar h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.topbar .sub { color: var(--mut); font-size: 14px; margin-top: 5px; }
.topbar .grow { flex: 1; }

/* ---------- componentes ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; transition: .15s;
  border: 1px solid transparent; white-space: nowrap;
}
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(85, 70, 227, 0.3); }
.btn.primary:hover { background: #463ac4; }
.btn.ghost { background: #fff; border-color: var(--line-2); color: #33333b; font-weight: 500; }
.btn.ghost:hover { background: #f7f7f9; }
.btn.danger { background: #fff; color: var(--err); border-color: var(--err-line); font-weight: 500; }
.btn.danger:hover { background: var(--err-bg); }
.btn.sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px;
  font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent);
}
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.rec { background: #fdeef4; color: var(--accent-2); }
.mut { color: var(--mut); }
.small { font-size: 12.5px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 26px; }
.kpi { padding: 20px 22px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.kpi.grad { background: var(--sidebar); color: #fff; border: 0; }
.kpi .label { font-size: 11px; opacity: 1; font-weight: 600; text-transform: uppercase; letter-spacing: 0.09em; color: var(--mut-3); }
.kpi.grad .label { color: #a9a4e6; }
.kpi .value { font-size: 38px; font-weight: 700; letter-spacing: -0.03em; margin: 8px 0 3px; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 12.5px; color: var(--mut-2); }
.kpi.grad .hint { color: #8e8ea0; }

/* toast */
#toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 300; }
.toast {
  background: var(--sidebar); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22); animation: pop 0.18s ease; max-width: 380px;
}
.toast.err { background: #7f1d1d; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(20, 20, 25, 0.42); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 200;
}
.modal { background: #fff; border-radius: var(--radius); padding: 26px; width: min(560px, 92vw); box-shadow: 0 24px 60px rgba(0,0,0,.24); }
.modal h3 { margin-bottom: 14px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.hidden { display: none !important; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { background: var(--sidebar); color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.login-hero h2 { font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.login-hero p { color: #a8a8b8; font-size: 16px; max-width: 420px; line-height: 1.5; }
.login-hero .logo-row { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; margin-bottom: 26px; }
.login-hero .logo-row img { width: 44px; height: 44px; border-radius: 12px; }
.login-panel { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(380px, 100%); }
.login-card h1 { font-size: 24px; margin-bottom: 6px; font-weight: 700; letter-spacing: -0.02em; }
.login-card .mut { margin-bottom: 22px; display: block; }
.login-card label { font-size: 13px; font-weight: 500; color: var(--mut); display: block; margin: 14px 0 6px; }
.demo-hint { margin-top: 18px; padding: 12px 14px; background: var(--accent-soft); border-radius: 10px; font-size: 13px; color: #4b4d75; line-height: 1.5; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-hero { display: none; } }

/* ---------- dashboard ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.toolbar .search { flex: 1; min-width: 220px; max-width: 380px; position: relative; }
.toolbar .search input { padding-left: 38px; }
.toolbar .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--mut-4); }
.space-pill {
  padding: 9px 14px; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line-2);
  font-weight: 500; font-size: 13px; color: #5b5b66; transition: .15s;
}
.space-pill:hover { border-color: #c9c9d1; }
.space-pill.active { background: var(--sidebar); color: #fff; border-color: var(--sidebar); }
.grid-guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.gcard { overflow: hidden; cursor: pointer; transition: box-shadow .15s, border-color .15s; position: relative; }
.gcard:hover { box-shadow: var(--shadow-hover); border-color: #dcdce2; }
.gcard .thumb { height: 170px; background: #eef1f6; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gcard .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.gcard .thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: 0.15s;
  background: rgba(20, 20, 25, 0.28);
}
.gcard:hover .thumb .play { opacity: 1; }
.gcard .thumb .play span {
  width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, 0.95); display: grid; place-items: center;
  color: var(--accent); font-size: 18px; padding-left: 3px; box-shadow: 0 4px 16px rgba(17, 17, 26, 0.18);
}
.gcard .body { padding: 16px 18px 18px; }
.gcard .title { font-weight: 600; font-size: 15.5px; line-height: 1.3; letter-spacing: -0.01em; }
.gcard .meta { display: flex; gap: 8px; align-items: center; margin-top: 10px; color: var(--mut-2); font-size: 12px; flex-wrap: wrap; }
.gcard .steps-badge {
  position: absolute; top: 12px; right: 12px; background: rgba(20, 20, 25, 0.82); color: #fff;
  padding: 4px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; backdrop-filter: blur(4px);
}
.empty { text-align: center; padding: 70px 20px; color: var(--mut); }
.empty h3 { color: var(--ink); margin-bottom: 8px; font-weight: 600; }

/* ---------- editor ---------- */
.editor-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.steps-rail { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow: auto; padding: 16px; }
.steps-rail h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--mut-3); font-weight: 600; margin-bottom: 12px; padding: 0 4px; }
.step-item { border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; cursor: pointer; transition: .15s; margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.step-item:hover { border-color: #dcdce2; }
.step-item.active { border-color: var(--accent-soft-line); background: var(--accent-soft-2); }
.step-item img { width: 52px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid #e8e8ec; flex: 0 0 auto; }
.step-item .n { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--mut-4); }
.step-item.active .n { color: var(--accent); }
.step-item .t { font-size: 13px; font-weight: 500; line-height: 1.3; color: #2a2a32; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.step-item .mini { display: flex; flex-direction: column; gap: 3px; margin-left: auto; }
.step-item .mini button { color: #b9b9c4; padding: 1px 4px; border-radius: 6px; font-size: 11px; }
.step-item .mini button:hover { background: #ededf3; color: var(--ink); }
.stage-wrap { padding: 16px; }
.stage-tools { display: flex; gap: 7px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.tool {
  padding: 8px 13px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff;
  font-size: 13px; font-weight: 500; color: #33333b; display: inline-flex; gap: 6px; align-items: center;
}
.tool.active { background: var(--sidebar); color: #fff; border-color: var(--sidebar); }
.tool:hover:not(.active) { background: #f7f7f9; }
.stage-box { position: relative; background: #101014; border-radius: 12px; overflow: hidden; }
.stage-box canvas { display: block; width: 100%; cursor: crosshair; }
.stage-hint { font-size: 12.5px; color: var(--mut-3); margin-top: 12px; }
.side-panel { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 18px; }
.side-panel .card { padding: 20px; }
.side-panel h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--mut-3); font-weight: 600; margin-bottom: 16px; }
.field { margin-bottom: 16px; }
.field label { font-size: 12.5px; font-weight: 500; display: block; margin-bottom: 6px; color: var(--mut); }
audio { width: 100%; height: 36px; margin-top: 8px; }
.editor-top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.editor-top input.title {
  font-size: 20px; font-weight: 700; letter-spacing: -0.02em; border: 1px solid transparent; background: transparent; padding: 6px 10px;
}
.editor-top input.title:hover, .editor-top input.title:focus { background: #fff; border-color: var(--line-2); }
.save-dot { font-size: 12px; color: var(--mut-3); min-width: 86px; }

/* ---------- página compartida (1b · split claro interactivo) ---------- */
.player-body { background: #e9e9ee; min-height: 100vh; color: var(--ink); }
.share-shell { max-width: 1000px; margin: 0 auto; padding: 40px 24px 60px; }
.share-card {
  background: #fff; border: 1px solid #dcdce2; border-radius: 18px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(17, 17, 26, 0.12);
}
.share-topbar {
  background: #fff; border-bottom: 1px solid var(--line); padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.share-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.share-brand img { width: 32px; height: 32px; border-radius: 9px; flex: 0 0 auto; }
.share-brand .pname { font-weight: 700; font-size: 15px; }
.share-brand .divider { width: 1px; height: 18px; background: var(--line-2); }
.share-brand .ptitle { font-size: 13.5px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-topbar .actions { display: flex; gap: 9px; }

.share-split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.share-player { padding: 26px 26px 30px; border-right: 1px solid var(--line); min-width: 0; }
.share-player h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.share-player .subtitle { font-size: 13.5px; color: var(--mut); margin-bottom: 18px; }

.stage {
  position: relative; border-radius: 14px; overflow: hidden; background: #fbfbfc;
  border: 1px solid #e0e0e6; box-shadow: 0 8px 30px rgba(17, 17, 26, 0.14);
}
.stage .chrome {
  height: 30px; background: #eceef2; display: flex; align-items: center; gap: 6px; padding: 0 12px;
}
.stage .chrome i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.stage .chrome .u { flex: 1; max-width: 340px; margin-left: 8px; height: 16px; background: #fff; border-radius: 20px; }
.stage .frame { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #fbfbfc; }
.stage .frame .imgbox { position: relative; transition: transform 0.9s cubic-bezier(.4,.1,.2,1); will-change: transform; line-height: 0; }
.stage .frame canvas { display: block; max-width: 100%; height: auto; }
.spot {
  position: absolute; border: 3px solid var(--accent); border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(85, 70, 227, 0.2); animation: pulse 1.4s infinite;
  transform: translate(-50%, -50%); pointer-events: none; z-index: 3;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 13px rgba(85, 70, 227, 0.06); } }
.captions { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; pointer-events: none; z-index: 4; padding: 0 14px; }
.captions span {
  background: rgba(20, 20, 25, 0.9); color: #fff; padding: 9px 16px; border-radius: 9px; font-size: 13.5px;
  max-width: 92%; text-align: center; line-height: 1.35; backdrop-filter: blur(4px);
}
.bigplay { position: absolute; inset: 0; display: grid; place-items: center; cursor: pointer; z-index: 5; }
.bigplay span {
  width: 66px; height: 66px; border-radius: 50%; background: var(--accent); display: grid; place-items: center;
  font-size: 24px; color: #fff; padding-left: 4px; box-shadow: 0 8px 24px rgba(85, 70, 227, 0.5);
  transition: transform .15s;
}
.bigplay:hover span { transform: scale(1.06); }
.pcontrols { background: var(--sidebar); display: flex; align-items: center; gap: 14px; padding: 11px 16px; }
.pcontrols button { color: #fff; font-size: 14px; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: 0 0 auto; }
.pcontrols button:hover { background: rgba(255, 255, 255, 0.12); }
.pcontrols .info { font-size: 12px; color: #b8b8c2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pcontrols .track { flex: 1; height: 4px; background: #33333c; border-radius: 2px; overflow: hidden; cursor: pointer; min-width: 40px; }
.pcontrols .track i { display: block; height: 100%; width: 0%; background: var(--accent); border-radius: 2px; }
.share-actions { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; }

/* navegador de pasos (columna derecha) */
.steps-nav { padding: 22px 20px; background: #fafafb; }
.steps-nav .snav-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.steps-nav .snav-head .lbl { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--mut-3); }
.steps-nav .snav-head .count { font-size: 12px; color: var(--mut); font-weight: 600; font-variant-numeric: tabular-nums; }
.steps-nav .snav-progress { height: 5px; background: var(--line); border-radius: 3px; margin-bottom: 16px; overflow: hidden; }
.steps-nav .snav-progress i { display: block; height: 100%; width: 0%; background: var(--accent); border-radius: 3px; transition: width .2s; }
.steps-nav .snav-list { display: flex; flex-direction: column; gap: 6px; }
.snav-item { display: flex; gap: 11px; padding: 11px 12px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; transition: background .12s, border-color .12s; }
.snav-item:hover { background: #f2f2f6; }
.snav-item.active { background: var(--accent-soft-2); border-color: var(--accent-soft-line); }
.snav-item .num {
  width: 22px; height: 22px; border-radius: 7px; background: #eceef2; color: var(--mut); font-size: 12px; font-weight: 700;
  display: grid; place-items: center; flex: 0 0 auto;
}
.snav-item.active .num, .snav-item.done .num { background: var(--accent); color: #fff; }
.snav-item .st { font-size: 13px; font-weight: 500; color: #3a3a44; line-height: 1.3; }
.snav-item.active .st { font-weight: 600; color: var(--ink); }
.snav-item .time { font-size: 11.5px; color: var(--mut-4); margin-top: 2px; font-variant-numeric: tabular-nums; }

/* documento (Ver documento) */
.doc-section { margin-top: 34px; }
.doc-section h2 { font-size: 22px; margin-bottom: 6px; font-weight: 700; letter-spacing: -0.02em; }
.doc-section .mut { color: var(--mut); margin-bottom: 20px; }
.doc-step {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-top: 14px;
  display: grid; gap: 14px; box-shadow: var(--shadow);
}
.doc-step .head { display: flex; gap: 12px; align-items: center; }
.doc-step .num {
  background: var(--accent); color: #fff; font-weight: 700; width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 8px; display: grid; place-items: center; font-size: 13px;
}
.doc-step h3 { font-size: 15.5px; font-weight: 600; }
.doc-step p { color: var(--mut); font-size: 13.5px; line-height: 1.5; padding-left: 38px; }
.doc-step canvas { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.player-footer { text-align: center; margin-top: 40px; color: var(--mut-3); font-size: 13px; }
.player-footer a { color: var(--accent); font-weight: 700; }

/* embed: solo el player, sin cabecera ni sidebar */
.embed-body { background: #fff; }
.embed-body .stage { border-radius: 0; border: 0; box-shadow: none; height: 100vh; display: flex; flex-direction: column; }
.embed-body .stage .frame { flex: 1; min-height: 0; }

@media (max-width: 820px) {
  .share-split { grid-template-columns: 1fr; }
  .share-player { border-right: 0; border-bottom: 1px solid var(--line); }
  .steps-nav .snav-list { max-height: 320px; overflow: auto; }
}

/* ---------- settings / analytics ---------- */
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; }
.panel { padding: 24px; }
.panel h3 { font-size: 16px; font-weight: 600; margin-bottom: 18px; letter-spacing: -0.01em; }
.token-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #f5f5f7; }
.token-row:last-child { border-bottom: 0; }
.token-row code { background: #f2f2f5; padding: 2px 6px; border-radius: 4px; font-size: 12px; font-family: ui-monospace, monospace; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mut-4); font-weight: 600; padding: 0 10px 10px; border-bottom: 1px solid #f0f0f3; }
.table td { padding: 13px 10px; border-bottom: 1px solid #f5f5f7; font-size: 13.5px; }
.table tr:hover td { background: #fafafb; }
.color-dot { width: 26px; height: 26px; border-radius: 8px; display: inline-block; cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); }
input[type="color"] { padding: 2px; height: 40px; width: 56px; border-radius: 8px; cursor: pointer; }
.copy-box { display: flex; gap: 8px; }
.copy-box input { font-size: 13px; background: #f7f7f9; }

@media (max-width: 1100px) {
  .editor-shell { grid-template-columns: 1fr; }
  .steps-rail, .side-panel { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .main { padding: 24px 20px 50px; }
}
