/* ══════════════════════════════════════════════════════════
   Imanol-bot — sistema de diseño
   ══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #07080c;
  --bg-elevated: #0e1017;
  --surface: #14171f;
  --surface-2: #1b1f2a;
  --surface-3: #232838;
  --border: #252a37;
  --border-bright: #333a4d;

  --text: #f0f2f8;
  --text-muted: #9aa2b8;
  --text-faint: #646c82;

  --accent: #8b5cf6;
  --accent-2: #6366f1;
  --accent-glow: #a78bfa;
  --accent-soft: rgba(139, 92, 246, .14);

  --twitch: #a970ff;
  --kick: #53fc18;
  --youtube: #ff4444;

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, .13);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .13);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .13);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 24px 70px -24px rgba(0, 0, 0, .75);
  --shadow-sm: 0 6px 20px -8px rgba(0, 0, 0, .5);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -.025em; margin: 0; font-weight: 800; }
p { color: var(--text-muted); line-height: 1.65; margin: 0; }
img { max-width: 100%; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 780px; }

/* ── Fondo con luces ── */
.glow-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 12% -8%, rgba(139, 92, 246, .18), transparent 60%),
    radial-gradient(50rem 36rem at 88% 4%, rgba(99, 102, 241, .13), transparent 58%),
    radial-gradient(40rem 30rem at 50% 100%, rgba(167, 139, 250, .07), transparent 60%);
}

/* ── Nav ── */
.site-nav {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: blur(18px) saturate(160%);
  background: rgba(7, 8, 12, .72);
  border-bottom: 1px solid var(--border);
}
.site-nav .container { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.06rem; letter-spacing: -.02em; }
.brand .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-glow), var(--accent-2));
  box-shadow: 0 0 18px var(--accent);
  animation: pulse 3s var(--ease) infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .68; transform: scale(.88); } }

.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { color: var(--text-muted); font-size: .91rem; font-weight: 500; transition: color .18s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
@media (max-width: 780px) { .nav-links { display: none; } }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 21px; border-radius: 999px; font-size: .92rem; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  font-family: var(--font);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .18s, border-color .18s, opacity .18s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; box-shadow: 0 10px 30px -10px rgba(139, 92, 246, .7);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 38px -10px rgba(139, 92, 246, .85); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-bright); }
.btn-google { background: #fff; color: #1f2430; font-weight: 600; }
.btn-google:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -12px rgba(255, 255, 255, .3); }
.btn-lg { padding: 15px 30px; font-size: 1rem; }
.btn-sm { padding: 7px 14px; font-size: .81rem; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(248, 113, 113, .3); }
.btn-danger:hover { background: rgba(248, 113, 113, .2); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-twitch { background: var(--twitch); color: #fff; }
.btn-kick { background: var(--kick); color: #05230a; }
.btn-youtube { background: var(--youtube); color: #fff; }
.btn-twitch:hover, .btn-kick:hover, .btn-youtube:hover { transform: translateY(-2px); filter: brightness(1.08); }

/* ── Hero ── */
.hero { padding: 104px 0 76px; text-align: center; position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, .3); border-radius: 999px;
  padding: 7px 16px; font-size: .8rem; color: var(--accent-glow); margin-bottom: 26px; font-weight: 500;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 900; letter-spacing: -.04em; }
.grad {
  background: linear-gradient(120deg, var(--accent-glow) 10%, var(--accent-2) 55%, #c4b5fd 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { max-width: 620px; margin: 24px auto 0; font-size: 1.13rem; }
.hero-actions { display: flex; justify-content: center; gap: 14px; margin-top: 38px; flex-wrap: wrap; }
.platform-badges { display: flex; justify-content: center; gap: 10px; margin-top: 34px; flex-wrap: wrap; }
.pbadge {
  display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); padding: 7px 15px; border-radius: 999px;
}
.pbadge.tw { color: var(--twitch); border-color: rgba(169, 112, 255, .3); }
.pbadge.ki { color: var(--kick); border-color: rgba(83, 252, 24, .25); }
.pbadge.yt { color: var(--youtube); border-color: rgba(255, 68, 68, .3); }

/* ── Secciones ── */
section { padding: 76px 0; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 50px; }
.section-head h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); }
.section-head p { margin-top: 14px; font-size: 1.02rem; }
.tag {
  display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent-glow); margin-bottom: 14px;
}

/* ── Grids y tarjetas ── */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(160deg, var(--surface), var(--bg-elevated));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; transition: border-color .25s, transform .25s var(--ease), box-shadow .25s;
  position: relative; overflow: hidden;
}
.card:hover { border-color: var(--border-bright); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.card .icon {
  font-size: 1.4rem; margin-bottom: 16px; width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center;
}
.card h3 { font-size: 1.06rem; margin-bottom: 9px; font-weight: 700; }
.card p { font-size: .93rem; }

/* ── Pasos ── */
.steps { display: grid; gap: 26px; }
.step { display: flex; gap: 20px; align-items: flex-start; }
.step .num {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .95rem;
  box-shadow: 0 8px 22px -8px rgba(139, 92, 246, .7);
}
.step h3 { font-size: 1.04rem; margin-bottom: 6px; }
.step p { font-size: .94rem; }

/* ── Bloques de código ── */
pre.code, code.inline {
  background: var(--bg-elevated); border: 1px solid var(--border);
  font-family: 'SF Mono', 'Cascadia Code', Consolas, monospace;
}
pre.code {
  border-radius: var(--radius-sm); padding: 16px 18px; overflow-x: auto;
  font-size: .84rem; color: var(--accent-glow); margin: 14px 0 0;
}
code.inline { border-radius: 6px; padding: 2px 7px; font-size: .86em; color: var(--accent-glow); }

/* ── Footer ── */
footer { border-top: 1px solid var(--border); padding: 44px 0; margin-top: 60px; }
footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
footer, footer a { color: var(--text-faint); font-size: .83rem; }
footer a:hover { color: var(--text-muted); }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }

/* ── Login ── */
.auth-wrap { min-height: calc(100vh - 68px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card {
  width: 100%; max-width: 400px; background: linear-gradient(160deg, var(--surface), var(--bg-elevated));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 42px 34px; text-align: center; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.42rem; margin-bottom: 10px; }
.auth-card p { font-size: .9rem; margin-bottom: 28px; }
.auth-note { margin-top: 22px; font-size: .78rem; color: var(--text-faint); line-height: 1.6; }

/* ══════════════════════════════════════════════════════════
   Panel autenticado
   ══════════════════════════════════════════════════════════ */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 248px; flex-shrink: 0; background: rgba(14, 16, 23, .8);
  backdrop-filter: blur(12px); border-right: 1px solid var(--border);
  padding: 22px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; z-index: 40;
}
.app-sidebar .brand { padding: 6px 10px 24px; }
.app-nav { display: flex; flex-direction: column; gap: 3px; }
.app-nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 13px;
  border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: .89rem; font-weight: 500; transition: background .18s, color .18s;
}
.app-nav a:hover { background: var(--surface); color: var(--text); }
.app-nav a.active { background: var(--accent-soft); color: var(--accent-glow); font-weight: 600; }
.app-sidebar .spacer { flex: 1; }

.user-chip {
  display: flex; align-items: center; gap: 11px; padding: 11px;
  border-radius: var(--radius-sm); background: var(--surface); font-size: .82rem;
  border: 1px solid var(--border); min-width: 0;
}
.user-chip img { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; }
.user-chip > div { min-width: 0; }
.user-chip .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .email { color: var(--text-faint); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-main { flex: 1; padding: 40px 44px 100px; max-width: 940px; min-width: 0; }
.app-main > h1 { font-size: 1.72rem; margin-bottom: 8px; }
.app-main > p.lead { margin-bottom: 12px; font-size: .96rem; }

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .app-sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--border); }
  .app-nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .app-nav a { white-space: nowrap; }
  .app-sidebar .spacer { display: none; }
  .app-main { padding: 28px 20px 80px; }
}

.panel-card {
  background: linear-gradient(160deg, var(--surface), var(--bg-elevated));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 28px; margin-top: 18px;
}
.panel-card > h3 { font-size: 1.08rem; margin-bottom: 6px; }
.panel-card > p.hint { font-size: .87rem; margin-bottom: 18px; }

.section-title {
  display: flex; align-items: center; gap: 10px; margin: 44px 0 0;
  font-size: 1.24rem; font-weight: 800; letter-spacing: -.02em;
}
.section-title:first-of-type { margin-top: 26px; }

/* ── Formularios ── */
.field-label { display: block; font-size: .82rem; color: var(--text-muted); margin: 18px 0 7px; font-weight: 500; }
.field-label:first-child { margin-top: 0; }
.input, textarea.input, select.input {
  width: 100%; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 11px 14px; font-size: .91rem; font-family: var(--font);
  transition: border-color .18s, box-shadow .18s;
}
.input:focus, textarea.input:focus, select.input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder { color: var(--text-faint); }
.input:disabled { opacity: .6; cursor: not-allowed; }
textarea.input { min-height: 92px; resize: vertical; line-height: 1.6; }
.hstack { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hstack .input { flex: 1; min-width: 120px; }
.field-hint { font-size: .78rem; color: var(--text-faint); margin-top: 6px; line-height: 1.5; }

/* ── Interruptores ── */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 0; border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row .tr-text { min-width: 0; }
.toggle-row .tr-title { font-size: .93rem; font-weight: 600; }
.toggle-row .tr-desc { font-size: .81rem; color: var(--text-faint); margin-top: 3px; line-height: 1.5; }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0; background: var(--surface-3);
  border-radius: 999px; transition: background .22s var(--ease);
}
.switch .slider::before {
  content: ''; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .22s var(--ease);
}
.switch input:checked + .slider { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ── Chips y pills ── */
.chip {
  display: inline-flex; align-items: center; gap: 8px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 13px;
  margin: 5px 6px 0 0; font-size: .81rem;
}
.chip button {
  border: none; background: none; color: var(--text-faint); cursor: pointer;
  font-size: .95rem; padding: 0; line-height: 1; transition: color .15s;
}
.chip button:hover { color: var(--danger); }

.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px;
  border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1px solid transparent;
}
.pill-on { background: var(--success-soft); color: var(--success); border-color: rgba(52, 211, 153, .3); }
.pill-off { background: var(--surface-2); color: var(--text-faint); border-color: var(--border); }
.pill-warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(251, 191, 36, .3); }
.pill .dot-s { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-on .dot-s { animation: pulse 2s var(--ease) infinite; }

/* ── Filas de plataforma ── */
.plat-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 17px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.plat-row:last-child { border-bottom: none; }
.plat-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.plat-icon {
  width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center;
  justify-content: center; font-size: 1.2rem; flex-shrink: 0; background: var(--surface-2);
}
.plat-icon.tw { background: rgba(169, 112, 255, .15); }
.plat-icon.ki { background: rgba(83, 252, 24, .12); }
.plat-icon.yt { background: rgba(255, 68, 68, .13); }
.plat-icon.ob { background: var(--accent-soft); }
.plat-name { font-weight: 700; font-size: .96rem; }
.plat-sub { font-size: .81rem; color: var(--text-faint); margin-top: 2px; }
.plat-actions { display: flex; gap: 8px; align-items: center; }

/* ── Tablas ── */
.table-wrap { overflow-x: auto; margin-top: 14px; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 460px; }
table.data th {
  text-align: left; color: var(--text-faint); font-weight: 600; font-size: .73rem;
  text-transform: uppercase; letter-spacing: .06em; padding: 9px 11px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 12px 11px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .15s; }
table.data tbody tr:hover { background: rgba(255, 255, 255, .02); }
table.data .actions { display: flex; gap: 6px; justify-content: flex-end; }
.mono { font-family: 'SF Mono', Consolas, monospace; font-size: .86em; color: var(--accent-glow); }

.empty-state { text-align: center; padding: 34px 20px; color: var(--text-faint); font-size: .89rem; }

/* ── Rank ── */
.rank-n { display: inline-flex; align-items: center; justify-content: center; width: 24px; font-weight: 700; color: var(--text-faint); }
.rank-1 { color: #fbbf24; } .rank-2 { color: #cbd5e1; } .rank-3 { color: #d97706; }

/* ── Aviso ── */
.notice {
  border-radius: var(--radius-sm); padding: 14px 16px; font-size: .87rem;
  line-height: 1.6; border: 1px solid; margin-top: 16px;
}
.notice-info { background: var(--accent-soft); border-color: rgba(139, 92, 246, .3); color: #ddd6fe; }
.notice-warn { background: var(--warn-soft); border-color: rgba(251, 191, 36, .3); color: #fde68a; }
.notice strong { color: #fff; }

/* ── Código de emparejamiento ── */
.pair-code {
  font-family: 'SF Mono', Consolas, monospace; font-size: 1.6rem; font-weight: 700;
  letter-spacing: .18em; color: var(--accent-glow); background: var(--bg-elevated);
  border: 1px dashed rgba(139, 92, 246, .4); border-radius: var(--radius-sm);
  padding: 16px; text-align: center; text-transform: uppercase;
}

/* ── Toast ── */
.toast {
  position: fixed; bottom: 26px; right: 26px; z-index: 200;
  background: var(--success); color: #04291d; padding: 13px 20px; border-radius: 12px;
  font-size: .87rem; font-weight: 600; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .28s var(--ease), transform .28s var(--ease);
  max-width: calc(100vw - 52px);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); color: #2b0707; }

/* ── Animación de entrada ── */
.reveal { opacity: 0; transform: translateY(18px); animation: reveal .7s var(--ease) forwards; }
@keyframes reveal { to { opacity: 1; transform: none; } }
.reveal-1 { animation-delay: .05s; } .reveal-2 { animation-delay: .13s; }
.reveal-3 { animation-delay: .21s; } .reveal-4 { animation-delay: .29s; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
