/* ========== BASE ========== */
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ========== FRAMES ========== */
.desktop-frame {
  width: 960px;
  height: 600px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.18);
  background: white;
  display: flex;
  flex-direction: column;
}
.desktop-titlebar {
  height: 28px;
  background: #1f2937;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
  color: #e5e7eb;
  font-size: 12px;
  flex-shrink: 0;
}
.desktop-body {
  flex: 1;
  min-height: 0;
}
.phone-frame {
  width: 320px;
  height: 660px;
  border-radius: 44px;
  background: #0f172a;
  padding: 12px;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}
.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 32px;
  background: #f8fafc;
  overflow: hidden;
  position: relative;
}
.notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 20px;
  background: #0f172a;
  border-radius: 14px;
  z-index: 10;
}

/* ========== SCREENS ========== */
[data-screen]:not([data-active]) {
  display: none !important;
}

/* ========== BITS ========== */
.slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: white;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.slider-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
}
.photo {
  background:
    radial-gradient(circle at 30% 30%, #fde68a 0%, transparent 40%),
    radial-gradient(circle at 70% 60%, #fca5a5 0%, transparent 45%),
    linear-gradient(135deg, #fef3c7, #fbcfe8);
}
.photo-alt {
  background:
    radial-gradient(circle at 60% 40%, #fde68a 0%, transparent 40%),
    radial-gradient(circle at 30% 70%, #fda4af 0%, transparent 45%),
    linear-gradient(135deg, #fffbeb, #fce7f3);
}
.grid-thirds {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.6) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.6) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
  background-position: center;
}
.grid-fifths {
  background-image:
    linear-gradient(to right, rgba(20, 184, 166, 0.55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20, 184, 166, 0.55) 1px, transparent 1px);
  background-size: 20% 20%;
  background-position: center;
}
.grid-facial {
  background-image:
    linear-gradient(to right, rgba(20, 184, 166, 0.65) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20, 184, 166, 0.65) 1px, transparent 1px);
  background-size: 50% 33.333%;
  background-position: center;
}
.grid-fine {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.4) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.4) 1px, transparent 1px);
  background-size: 16.666% 16.666%;
  background-position: center;
}

/* ========== CAMERA (mobile) ========== */
.cam-btn {
  width: 30px;
  height: 30px;
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}
.cam-btn[data-on] {
  background: rgba(13, 148, 136, 0.32);
  border-color: rgba(94, 234, 212, 0.55);
  color: #5eead4;
}
.cam-cat {
  flex: 1;
  padding: 6px 2px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}
.cam-cat[data-active] {
  background: rgba(94, 234, 212, 0.12);
  color: #5eead4;
  font-weight: 600;
}
.cam-pose {
  flex-shrink: 0;
  width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.cam-pose-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  position: relative;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
}
.cam-pose[data-active] .cam-pose-icon {
  background: rgba(13, 148, 136, 0.25);
  border-color: #0d9488;
  color: #0d9488;
}
.cam-pose[data-captured]:not([data-active]) .cam-pose-icon {
  border-color: rgba(94, 234, 212, 0.35);
  color: #5eead4;
}
.cam-pose[data-captured] .cam-pose-icon::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5eead4;
  border: 1.5px solid #0f172a;
}
.cam-pose-label {
  color: #94a3b8;
  font-size: 9px;
  text-align: center;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cam-pose[data-active] .cam-pose-label {
  color: #5eead4;
  font-weight: 600;
}
.cam-shutter-outer {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
}
.cam-shutter-inner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: white;
}
.cam-silhouette {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.cam-ghost-preview {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 40% 42%, #fde68a 0%, transparent 38%),
    radial-gradient(circle at 65% 55%, #fca5a5 0%, transparent 42%),
    linear-gradient(135deg, #fef3c7, #fbcfe8);
  opacity: 0.35;
  mix-blend-mode: normal;
}
.cam-carrete-tile {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid #0d9488;
  position: relative;
  flex-shrink: 0;
}
.cam-carrete-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 9px;
  background: rgba(15, 15, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f87171;
  font-size: 11px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* ========== TOAST ========== */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #0f172a;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 200;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast[data-show] {
  opacity: 1;
  transform: translateY(0);
}

/* ========== TOUR — Apple-style ==========
 * Visual language matches the landing page (apps/web):
 *  - `#fbfbfd` page background, ink-700 text.
 *  - Translucent dark top bar, thin divider.
 *  - Primary actions are pill buttons filled with brand-500.
 *  - Cards use generous radius, a whisper-soft border, and a long,
 *    low-spread shadow. No heavy colored accents.
 *  - Motion uses Apple's signature ease `cubic-bezier(0.28, 0.11, 0.32, 1)`.
 */

/* Dim the page gently, like a modal over the landing's neutral BG. */
.tour-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(29, 29, 31, 0.22);
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.28, 0.11, 0.32, 1);
}
.tour-backdrop[data-on] {
  opacity: 1;
}

/*
 * Spotlight ring: a single crisp 2px brand stroke + a very soft outer
 * glow, plus a vignette behind to darken the rest of the page. Smooth
 * Apple-easing on every property.
 */
.tour-ring {
  position: absolute;
  border-radius: 14px;
  box-shadow:
    0 0 0 2px rgba(20, 184, 166, 0.95),
    0 0 0 8px rgba(20, 184, 166, 0.18),
    0 0 24px 4px rgba(20, 184, 166, 0.22),
    0 0 0 9999px rgba(29, 29, 31, 0.35);
  pointer-events: none;
  z-index: 95;
  transition:
    top 0.45s cubic-bezier(0.28, 0.11, 0.32, 1),
    left 0.45s cubic-bezier(0.28, 0.11, 0.32, 1),
    width 0.45s cubic-bezier(0.28, 0.11, 0.32, 1),
    height 0.45s cubic-bezier(0.28, 0.11, 0.32, 1),
    opacity 0.3s cubic-bezier(0.28, 0.11, 0.32, 1);
  opacity: 0;
}
.tour-ring[data-on] {
  opacity: 1;
}

/*
 * Floating card, docked at the bottom. White, minimal, a little padded.
 * Same vibe as the pricing / CTA cards on the landing: rounded-2xl,
 * tracking-tight copy, plenty of whitespace, no heavy borders.
 */
.tour-panel {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 24px));
  background: #ffffff;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 20px;
  box-shadow:
    0 1px 2px rgba(29, 29, 31, 0.04),
    0 24px 60px -20px rgba(29, 29, 31, 0.22);
  padding: 18px 22px 16px;
  z-index: 150;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 20px;
  row-gap: 12px;
  align-items: center;
  opacity: 0;
  transform: translate(-50%, 30px);
  transition:
    opacity 0.35s cubic-bezier(0.28, 0.11, 0.32, 1),
    transform 0.35s cubic-bezier(0.28, 0.11, 0.32, 1);
  pointer-events: none;
}
.tour-panel[data-on] {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
/* Stacked layout (phone below desktop): the panel is moved into the
 * inline slot between the two devices, so it reflows like normal
 * content instead of floating. No overlap with either device. */
.tour-panel[data-inline] {
  position: static;
  bottom: auto;
  left: auto;
  width: auto;
  max-width: 720px;
  margin: 16px auto;
  transform: none;
}
.tour-panel[data-inline][data-on] {
  transform: none;
}
.tour-panel-text {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  min-width: 0;
}
.tour-panel-actions {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tour-panel-progress {
  grid-column: 1 / 3;
  grid-row: 2 / 3;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: #86868b;
}
.tour-progress {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.08);
  overflow: hidden;
  position: relative;
}
.tour-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #2dd4bf, #14b8a6);
  transition: width 0.4s cubic-bezier(0.28, 0.11, 0.32, 1);
}
.tour-progress-count {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: #6e6e73;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.tour-title {
  font-size: 15px;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -0.015em;
  margin: 0;
}
.tour-body {
  font-size: 13px;
  color: #424245;
  margin: 4px 0 0 0;
  line-height: 1.55;
  letter-spacing: -0.005em;
}

/* Pill buttons, matching the landing's CTA style. */
.tour-btn {
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  padding: 8px 18px;
  transition:
    background 0.2s cubic-bezier(0.28, 0.11, 0.32, 1),
    color 0.2s cubic-bezier(0.28, 0.11, 0.32, 1),
    box-shadow 0.2s cubic-bezier(0.28, 0.11, 0.32, 1),
    transform 0.2s cubic-bezier(0.28, 0.11, 0.32, 1);
  cursor: pointer;
  white-space: nowrap;
  border: 0;
  letter-spacing: -0.005em;
}
.tour-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
.tour-btn-primary {
  background: #14b8a6;
  color: white;
  box-shadow: 0 6px 16px -6px rgba(20, 184, 166, 0.55);
}
.tour-btn-primary:hover:not(:disabled) {
  background: #2dd4bf;
  transform: translateY(-0.5px);
}
.tour-btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 10px -4px rgba(20, 184, 166, 0.45);
}
.tour-btn-ghost {
  background: transparent;
  color: #6e6e73;
  padding: 8px 12px;
}
.tour-btn-ghost:hover:not(:disabled) {
  color: #1d1d1f;
  background: rgba(29, 29, 31, 0.04);
}

/*
 * "Empezar tour" CTA in the header. Primary = white fill (keynote
 * style, sits on the dark nav). Ghost variant for "Volver a empezar".
 */
.tour-start-btn {
  background: white;
  color: #1d1d1f;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  border: 0;
  letter-spacing: -0.005em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition:
    background 0.2s cubic-bezier(0.28, 0.11, 0.32, 1),
    transform 0.2s cubic-bezier(0.28, 0.11, 0.32, 1);
}
.tour-start-btn:hover {
  background: #f5f5f7;
}
.tour-start-btn:active {
  transform: translateY(0.5px);
}
.tour-start-btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.tour-start-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

/* Initial CTA pulse — softer, teal, matches the brand button shadow. */
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(20, 184, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0); }
}
.hint-pulse { animation: pulse-ring 1.8s infinite; }

/* responsive */
@media (max-width: 1400px) {
  .both-layout { flex-direction: column; align-items: center; }
}

@media (max-width: 640px) {
  .tour-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: 16px 18px 14px;
    row-gap: 10px;
  }
  .tour-panel-text { grid-column: 1; grid-row: 1; }
  .tour-panel-actions {
    grid-column: 1;
    grid-row: 2;
    justify-content: flex-end;
  }
  .tour-panel-progress { grid-column: 1; grid-row: 3; }
}

@media (prefers-reduced-motion: reduce) {
  .tour-backdrop,
  .tour-ring,
  .tour-panel,
  .tour-progress-bar,
  .tour-btn,
  .tour-start-btn {
    transition: none !important;
  }
  .hint-pulse { animation: none !important; }
}
