/* WhisperWeb Cloud — tema oscuro glassmorphism */

[hidden] { display: none !important; }

:root {
  --bg: #0a0c14;
  --card: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.09);
  --text: #eef0f6;
  --muted: #9aa3b2;
  --accent: #8b5cf6;
  --accent2: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  font-family: "Plus Jakarta Sans", system-ui, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--accent2); }
code { font-family: "JetBrains Mono", monospace; font-size: 0.9em; background: rgba(0,0,0,.35); padding: 2px 6px; border-radius: 6px; }

/* fondo */
.bgfx { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.32; }
.orb.o1 { width: 540px; height: 540px; background: #6d28d9; top: -190px; left: -130px; }
.orb.o2 { width: 440px; height: 440px; background: #0e7490; bottom: -170px; right: -110px; }
.orb.o3 { width: 300px; height: 300px; background: #be185d; top: 38%; left: 58%; opacity: 0.16; }

.container { max-width: 980px; margin: 0 auto; padding: 0 20px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); background: rgba(10, 12, 20, 0.72); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-ic { width: 26px; height: 26px; color: var(--accent); }
.brand-name { font-weight: 800; letter-spacing: -0.02em; font-size: 18px; }
.brand-name b { color: var(--accent2); }
.nav-right { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill { font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--border); border-radius: 99px; padding: 5px 12px; white-space: nowrap; }
.pill.gpu { color: #86efac; border-color: rgba(52, 211, 153, 0.45); }
.pill.cpu { color: #fcd34d; border-color: rgba(251, 191, 36, 0.4); }
.pill.ok { color: var(--ok); border-color: rgba(52, 211, 153, 0.45); }

/* hero */
.hero { padding: 64px 0 30px; text-align: center; position: relative; }
h1 { font-size: clamp(32px, 5vw, 54px); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.grad { background: linear-gradient(90deg, #a78bfa, #22d3ee 55%, #f472b6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.subtitle { margin: 16px auto 0; max-width: 640px; color: var(--muted); font-size: 16.5px; }
.wavebars { display: flex; gap: 6px; justify-content: center; align-items: flex-end; height: 64px; margin-top: 26px; opacity: 0.5; pointer-events: none; }
.wavebars span { width: 6px; border-radius: 3px; height: 16px; background: linear-gradient(180deg, #a78bfa, #22d3ee); animation: wv 1.6s ease-in-out infinite; }
@keyframes wv { 0%, 100% { height: 14px; } 50% { height: 60px; } }

/* cards */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.028));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.step-num {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(34, 211, 238, 0.18));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: #fff;
}
.step-head h2 { font-size: 19px; font-weight: 700; }
.step-sub { color: var(--muted); font-size: 13px; }

/* modos */
.mode-toggle { display: flex; gap: 4px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: 14px; padding: 4px; width: 100%; max-width: 480px; }
.mode-btn {
  flex: 1; padding: 10px 8px; border: 0; background: transparent; color: var(--muted);
  font-weight: 600; font-size: 14px; border-radius: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px; transition: 0.2s;
  font-family: inherit;
}
.mode-btn:hover { color: #fff; }
.mode-btn.active { background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(34, 211, 238, 0.22)); color: #fff; box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.5); }
.mode-panel { margin-top: 18px; }

/* dropzone */
.dropzone {
  position: relative;
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 42px 20px;
  text-align: center;
  cursor: pointer;
  transition: 0.25s;
  background: rgba(255, 255, 255, 0.02);
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.drag { border-color: var(--accent); background: rgba(139, 92, 246, 0.09); transform: translateY(-1px); }
.dz-ic { width: 40px; height: 40px; color: var(--accent); margin: 0 auto 12px; display: block; }
.dz-main { font-size: 15.5px; }
.dz-hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
#fileInput { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }

/* chips de archivo */
.file-chip {
  display: flex; align-items: center; gap: 12px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 14px;
  padding: 12px 16px;
}
.chip-ic { font-size: 20px; }
.chip-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chip-info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-info span { color: var(--muted); font-size: 12px; }
.chip-x { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 6px; border-radius: 8px; }
.chip-x:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.chip-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-act {
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--border); color: var(--text);
  padding: 8px 13px; border-radius: 10px; font-weight: 600; font-size: 13px;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-family: inherit;
}
.chip-act:hover { border-color: var(--accent); color: #fff; }
#recPlayer { width: 100%; margin-top: 12px; }

/* grabadora */
.rec-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0 4px; }
.rec-visual { width: 100%; max-width: 460px; height: 96px; border-radius: 16px; border: 1px solid var(--border); background: rgba(0, 0, 0, 0.3); overflow: hidden; }
.rec-visual canvas { width: 100%; height: 100%; display: block; }
.rec-timer { font-family: "JetBrains Mono", monospace; font-size: 28px; font-weight: 600; letter-spacing: 3px; }
.rec-btn {
  width: 76px; height: 76px; border-radius: 50%;
  border: 1px solid rgba(167, 139, 250, 0.5);
  background: radial-gradient(circle at 35% 30%, rgba(139, 92, 246, 0.5), rgba(139, 92, 246, 0.14));
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.25s;
}
.rec-btn:hover { transform: scale(1.06); }
.rec-btn-core { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #a78bfa, #22d3ee); transition: 0.25s; }
.rec-btn.recording { border-color: rgba(244, 63, 94, 0.6); animation: recpulse 1.6s infinite; }
.rec-btn.recording .rec-btn-core { border-radius: 8px; background: linear-gradient(135deg, #fb7185, #f43f5e); }
@keyframes recpulse {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.3); }
  70% { box-shadow: 0 0 0 16px rgba(244, 63, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}
.rec-state { color: var(--muted); font-size: 14px; text-align: center; max-width: 480px; }
.rec-actions { display: flex; gap: 8px; }

/* modelos */
.model-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.model-card {
  position: relative; border: 1px solid var(--border); border-radius: 15px;
  padding: 16px 16px 13px; cursor: pointer; background: rgba(255, 255, 255, 0.03);
  transition: 0.2s; text-align: left; display: flex; flex-direction: column; gap: 3px; font-family: inherit;
}
.model-card:hover { border-color: rgba(167, 139, 250, 0.55); transform: translateY(-2px); }
.model-card.sel { border-color: var(--accent); background: linear-gradient(160deg, rgba(139, 92, 246, 0.2), rgba(34, 211, 238, 0.08)); box-shadow: 0 8px 26px rgba(139, 92, 246, 0.22); }
.mname { font-weight: 800; font-size: 16px; }
.mdesc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.mmeta { font-size: 11.5px; color: var(--accent2); font-family: "JetBrains Mono", monospace; }
.badge-rec { position: absolute; top: -9px; right: 12px; font-size: 10px; background: linear-gradient(90deg, #8b5cf6, #ec4899); padding: 3px 9px; border-radius: 99px; font-weight: 700; letter-spacing: 0.4px; color: #fff; }

.config-row { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.cfg-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.select {
  background: rgba(255, 255, 255, 0.06); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px; font-size: 14px; font-family: inherit; cursor: pointer; outline: none; min-width: 240px;
}
.select:focus { border-color: var(--accent); }
.hint { color: var(--muted); font-size: 13px; margin-top: 10px; }

/* CTA */
.cta-wrap { text-align: center; margin: 26px 0; }
.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 320px; max-width: 100%; padding: 17px 34px;
  font-size: 17px; font-weight: 700; border: 0; border-radius: 16px; color: #fff; cursor: pointer;
  background: linear-gradient(92deg, #7c3aed, #8b5cf6 40%, #ec4899);
  box-shadow: 0 12px 34px rgba(124, 58, 237, 0.45);
  transition: 0.22s; font-family: inherit;
}
.cta:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 44px rgba(124, 58, 237, 0.6); }
.cta:disabled { opacity: 0.4; cursor: not-allowed; }
.cta-arrow { font-size: 19px; }
.cta-hint { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* progreso */
.progress-top { display: flex; align-items: center; gap: 14px; }
.prog-spinner {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%;
  border: 2.5px solid rgba(139, 92, 246, 0.25); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-titles { flex: 1; min-width: 0; }
.progress-titles h3 { font-size: 16.5px; }
.progress-titles p { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.elapsed { font-family: "JetBrains Mono", monospace; font-size: 14px; color: var(--accent2); }
.bar { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; position: relative; margin: 18px 0 10px; }
.bar-fill { height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, #8b5cf6, #22d3ee); transition: width 0.4s ease; }
.bar-indet { position: absolute; inset: 0; display: none; }
.bar.indeterminate .bar-fill { width: 0 !important; }
.bar.indeterminate .bar-indet { display: block; }
.bar-indet::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 38%; border-radius: 99px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.9), transparent);
  animation: slide 1.15s ease-in-out infinite;
}
@keyframes slide { 0% { left: -40%; } 100% { left: 105%; } }
.progress-meta { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
#pctEl { font-weight: 700; color: var(--accent2); font-family: "JetBrains Mono", monospace; }
.steps { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin-top: 18px; }
.steps li {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted);
  padding: 7px 13px; border: 1px solid var(--border); border-radius: 99px; background: rgba(255, 255, 255, 0.03);
}
.steps li .dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }
.steps li.active { color: #fff; border-color: rgba(167, 139, 250, 0.6); }
.steps li.active .dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.18); animation: blink 1.2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.steps li.done { color: #86efac; border-color: rgba(52, 211, 153, 0.35); }
.steps li.done .dot { background: var(--ok); }
.progress-card.error { border-color: rgba(248, 113, 113, 0.5); background: rgba(248, 113, 113, 0.07); }
.progress-card.error .prog-spinner { display: none; }

/* resultado */
.result-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.result-titles h3 { font-size: 19px; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); border-radius: 99px; padding: 5px 13px; font-size: 12.5px; color: var(--text); font-weight: 600; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn2 {
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); color: var(--text);
  padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  cursor: pointer; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; font-family: inherit;
}
.btn2:hover { border-color: var(--accent); color: #fff; }
.btn2.primary { background: linear-gradient(92deg, #7c3aed, #ec4899); border-color: transparent; color: #fff; }
.dl-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); background: #161a2b;
  border: 1px solid var(--border); border-radius: 14px; padding: 7px; min-width: 250px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55); z-index: 60;
}
.menu a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 9px; color: var(--text); text-decoration: none; font-size: 14px; }
.menu a:hover { background: rgba(139, 92, 246, 0.15); }
.menu a span { color: var(--muted); font-size: 12px; font-family: "JetBrains Mono", monospace; }
.empty-note { padding: 28px; text-align: center; color: var(--muted); background: rgba(0,0,0,.2); border-radius: 14px; margin-bottom: 14px; }

.tabs { display: flex; gap: 5px; background: rgba(255, 255, 255, 0.05); border-radius: 12px; padding: 4px; width: fit-content; margin-bottom: 14px; }
.tab {
  padding: 8px 16px; border-radius: 9px; font-size: 13.5px; color: var(--muted); cursor: pointer;
  background: transparent; border: 0; transition: 0.2s; font-weight: 600; font-family: inherit;
}
.tab:hover { color: #fff; }
.tab.active { color: #fff; background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(34, 211, 238, 0.15)); }
.tab-pane[hidden] { display: none !important; }
.transcript {
  white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.85; color: #e6e9f2;
  background: rgba(0, 0, 0, 0.28); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px; max-height: 440px; overflow: auto; font-family: inherit;
}
.transcript::-webkit-scrollbar { width: 10px; }
.transcript::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 99px; }
.ts-list { display: flex; flex-direction: column; max-height: 440px; overflow: auto; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--border); border-radius: 14px; padding: 8px 16px; }
.tsrow { display: flex; gap: 14px; padding: 9px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); align-items: baseline; }
.tsrow:last-child { border-bottom: 0; }
.tschip { font-family: "JetBrains Mono", monospace; font-size: 12px; color: #c4b5fd; background: rgba(139, 92, 246, 0.14); border-radius: 8px; padding: 2px 9px; white-space: nowrap; flex: 0 0 auto; }
.tstext { font-size: 14.5px; }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 0 40px; }

/* toasts */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 999; width: min(480px, calc(100vw - 32px)); }
.toast-item {
  background: #171b2c; border: 1px solid var(--border); border-left: 3px solid var(--ok);
  padding: 12px 18px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); animation: up 0.28s ease;
}
.toast-item.err { border-left-color: var(--err); }
.toast-item.out { opacity: 0; transform: translateY(8px); transition: 0.32s; }
@keyframes up { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }

@media (max-width: 700px) {
  .card { padding: 18px; }
  .hero { padding: 44px 0 20px; }
  .nav-right .pill.ok { display: none; }
  .result-head { flex-direction: column; }
  .cta { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .wavebars span, .rec-btn.recording, .steps li.active .dot, .prog-spinner { animation: none !important; }
}
