:root {
  --bg: #000000;
  --primary: #7302ff;
  --text: #ffffff;
  --hover: #eee6ff;
  --card: #0b0b10;
  --stroke: #1d152c;
  --muted: #ada6c4;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(115, 2, 255, 0.24), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(115, 2, 255, 0.18), transparent 30%),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.bg-texture {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(120deg, rgba(255, 255, 255, 0.06), transparent 40%),
    url("../images/icono IA Glow.png");
  background-repeat: no-repeat;
  background-position: 85% 10%;
  background-size: 380px, 420px;
  opacity: 0.14;
  pointer-events: none;
  filter: blur(0.4px);
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: rgba(0, 0, 0, 0.86);
  border-bottom: 1px solid var(--stroke);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-logo {
  height: 46px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(115, 2, 255, 0.45));
}

.brand-title h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-title .label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.cta .hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.page {
  position: relative;
  z-index: 1;
  padding: 32px 28px 56px;
}

.intro {
  max-width: 900px;
  margin-bottom: 28px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(115, 2, 255, 0.14);
  color: var(--hover);
  font-size: 13px;
  border: 1px solid rgba(115, 2, 255, 0.35);
}

.intro h2 {
  margin: 12px 0 10px;
  font-size: 34px;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 780px;
}

.intro-actions {
  margin-top: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 340px));
  gap: 20px;
  justify-content: center;
}

.card {
  background: linear-gradient(165deg, rgba(35, 24, 51, 0.6), rgba(15, 12, 20, 0.8));
  border: 1px solid var(--stroke);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(115, 2, 255, 0.6);
  box-shadow: 0 25px 70px rgba(115, 2, 255, 0.24);
}

.video-shell {
  position: relative;
  height: 180px;
  background: #050507;
  overflow: hidden;
  border-bottom: 1px solid var(--stroke);
}

.video-shell video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05);
}

.card-body {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card h3 {
  margin: 0;
  font-size: 20px;
}

.goal {
  margin: 0;
  color: var(--hover);
  line-height: 1.5;
  min-height: 72px;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.primary {
  align-self: center;
  margin-top: auto;
  background: linear-gradient(120deg, #7302ff, #9a52ff);
  color: var(--text);
  border: 1px solid rgba(115, 2, 255, 0.6);
  padding: 11px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 14px 28px rgba(115, 2, 255, 0.35);
}

.primary:hover {
  background: #5b00d3;
  box-shadow: 0 16px 36px rgba(115, 2, 255, 0.45);
}

.primary:active {
  transform: translateY(1px);
}

.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Botón terminar conversación */
button.primary.end-mode {
  background: linear-gradient(120deg, #ec1919, #ef4444);
  border-color: rgba(220, 38, 38, 0.6);
  box-shadow: 0 14px 28px rgba(220, 38, 38, 0.35);
}

button.primary.end-mode:hover {
  background: #b91c1c;
  box-shadow: 0 16px 36px rgba(220, 38, 38, 0.45);
}

.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--stroke);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.secondary:hover {
  border-color: var(--hover);
  color: var(--hover);
}

.secondary:active {
  transform: translateY(1px);
}

.empty {
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
  backdrop-filter: blur(6px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #0c0c12;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  width: min(1100px, 100%);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--stroke);
}

.modal-header h3 {
  margin: 0;
}

.ghost {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 10px;
}

.ghost:hover {
  border-color: var(--hover);
}

.frame-wrap {
  aspect-ratio: 16 / 9;
  background: #000;
}

.frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0 0 18px 18px;
}

.frame-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0 0 18px 18px;
}

.is-hidden {
  display: none !important;
}

.landing-modal-content {
  width: min(900px, 70vw);
  height: 60vh;
  display: flex;
  flex-direction: column;
}

.landing-modal-frame {
  aspect-ratio: unset;
  height: 100%;
}

.landing-modal-frame iframe {
  border-radius: 0 0 18px 18px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1b1329;
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  z-index: 15;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.overlay.hidden {
  display: none;
}

.overlay-text {
  margin: 0;
  color: var(--hover);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.12);
  border-top-color: #7302ff;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 24px rgba(115, 2, 255, 0.35);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Landing page */
.landing-body {
  background: radial-gradient(circle at 12% 18%, rgba(115, 2, 255, 0.24), transparent 35%),
    radial-gradient(circle at 82% 6%, rgba(115, 2, 255, 0.18), transparent 30%),
    var(--bg);
}

.landing-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-top: 12px;
}

.landing-hero {
  width: 100%;
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 20px;
  align-items: stretch;
  padding: 18px 20px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(35, 24, 51, 0.68), rgba(11, 9, 15, 0.9));
  box-shadow: var(--shadow);
}

.landing-shell {
  width: min(1180px, 100%);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.landing-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.landing-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.landing-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.landing-heading {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.02em;
}

.landing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(115, 2, 255, 0.12);
  border: 1px solid rgba(115, 2, 255, 0.28);
  color: var(--hover);
  font-size: 13px;
}

.landing-instructions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.hint-card {
  width: 100%;
  height: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px dashed rgba(115, 2, 255, 0.35);
  background: rgba(10, 10, 14, 0.9);
  color: var(--hover);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.hint-title {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.hint-card .hint {
  margin: 0;
  color: var(--muted);
}

.pill.soft {
  background: rgba(115, 2, 255, 0.08);
  border-color: rgba(115, 2, 255, 0.26);
}

.landing-frame-section {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.landing-frame-section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(115, 2, 255, 0.16), rgba(0, 0, 0, 0.3));
  z-index: 0;
}

.section-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  text-align: center;
}

.section-overlay-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.section-overlay .spinner {
  width: 56px;
  height: 56px;
}

.overlay-sub {
  margin: 0;
  color: var(--muted);
}

.landing-frame {
  width: 100%;
  max-width: 1180px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  height: clamp(340px, 68vh, 820px);
  position: relative;
  z-index: 1;
  background: linear-gradient(160deg, rgba(35, 24, 51, 0.5), rgba(5, 5, 8, 0.9));
}

.landing-actions-center {
  justify-content: center;
}

/* Contenedor de Daily.js */
#daily-container,
  #daily-frame-container {
  width: 100%;
  height: 100%;
  background: #000;
}

.landing-frame #daily-container {
  position: absolute;
  inset: 0;
}

@media (max-width: 900px) {
  .landing-hero {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .landing-instructions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 18px;
  }

  .brand-logo {
    height: 38px;
  }

  .brand-title h1 {
    font-size: 18px;
  }

  .page {
    padding: 22px 18px 46px;
  }

  .landing-layout {
    padding-top: 4px;
  }

  .intro h2 {
    font-size: 28px;
  }

  .goal {
    min-height: auto;
  }

  .landing-meta {
    gap: 8px;
  }

  .chip {
    width: fit-content;
  }

  .landing-frame-section {
    padding: 4px;
  }

  .landing-hero {
    display: none;
  }

  .landing-frame {
    border-radius: 14px;
    height: clamp(320px, 72vh, 640px);
  }

  .bg-texture {
    background-size: 260px, 320px;
    background-position: 80% 6%;
    opacity: 0.12;
  }
}
