/* Mockup iPhone premium — conversas simuladas nas landings Kairos */

.landing-phone-demo {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin-inline: auto;
  filter: drop-shadow(0 40px 80px rgba(0, 0, 0, 0.55));
}

.landing-phone-demo--hero {
  max-width: 304px;
}

.landing-phone-demo--compact {
  max-width: 268px;
}

/* Metade superior visível — carrossel das landings (+50%: UI e balões na mesma proporção) */
.landing-phone-demo--half {
  --landing-phone-scale: 1.5;
  overflow: hidden;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 9 / 8;
  position: relative;
  zoom: var(--landing-phone-scale);
}

/* Firefox (sem zoom): reserva o espaço e escala o chassi (inclui balões) */
@supports not (zoom: 1) {
  .landing-phone-demo--half {
    max-width: calc(320px * var(--landing-phone-scale));
    zoom: unset;
  }

  .landing-phone-demo--half .landing-phone-demo__chassis {
    width: calc(100% / var(--landing-phone-scale));
    left: 50%;
    right: auto;
    transform: translateX(-50%) scale(var(--landing-phone-scale));
    transform-origin: top center;
  }
}

.landing-phone-demo--half .landing-phone-demo__glow {
  inset: 4% 4% 28%;
}

.landing-phone-demo--half .landing-phone-demo__chassis {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.landing-phone-demo--half::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3.5rem;
  background: linear-gradient(to bottom, transparent, #0b0c15 88%);
  pointer-events: none;
  z-index: 8;
}

.landing-phone-demo__glow {
  position: absolute;
  inset: 8% 4% -8%;
  background:
    radial-gradient(ellipse at 50% 72%, rgba(249, 115, 22, 0.28), transparent 62%),
    radial-gradient(ellipse at 30% 20%, rgba(148, 163, 184, 0.08), transparent 50%);
  filter: blur(36px);
  pointer-events: none;
  z-index: 0;
}

/* Chassi — titânio escuro estilo iPhone Pro */
.landing-phone-demo__chassis {
  position: relative;
  z-index: 1;
  padding: 0.22rem;
  border-radius: 3.35rem;
  background:
    linear-gradient(
      145deg,
      #4a4f5c 0%,
      #2a2d35 18%,
      #1a1c22 42%,
      #0f1014 68%,
      #252830 100%
    );
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 0 0 2px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    0 32px 64px -20px rgba(0, 0, 0, 0.85),
    0 12px 28px -8px rgba(0, 0, 0, 0.55);
}

.landing-phone-demo__chassis::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(255, 255, 255, 0.04) 22%,
    transparent 45%
  );
  pointer-events: none;
  z-index: 4;
}

.landing-phone-demo__chassis::after {
  content: "";
  position: absolute;
  inset: 0.22rem;
  border-radius: 3.1rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 4;
}

/* Botões laterais */
.landing-phone-demo__btn {
  position: absolute;
  border-radius: 2px;
  background: linear-gradient(90deg, #3d4149, #1e2026);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.4);
  z-index: 5;
}

.landing-phone-demo__btn--silent {
  left: -0.14rem;
  top: 22%;
  width: 0.16rem;
  height: 1.35rem;
}

.landing-phone-demo__btn--vol-up {
  left: -0.14rem;
  top: 30%;
  width: 0.16rem;
  height: 2.1rem;
}

.landing-phone-demo__btn--vol-down {
  left: -0.14rem;
  top: 38.5%;
  width: 0.16rem;
  height: 2.1rem;
}

.landing-phone-demo__btn--power {
  right: -0.14rem;
  top: 33%;
  width: 0.16rem;
  height: 3.1rem;
}

.landing-phone-demo__device {
  position: relative;
  border-radius: 3.1rem;
  overflow: hidden;
  aspect-ratio: 9 / 19.2;
  background: #000;
}

.landing-phone-demo--hero .landing-phone-demo__device,
.landing-phone-demo--compact .landing-phone-demo__device {
  aspect-ratio: 9 / 19;
}

.landing-phone-demo__screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #000;
  border-radius: 3.1rem;
  overflow: hidden;
}

/* Dynamic Island */
.landing-phone-demo__dynamic-island {
  position: absolute;
  top: 0.62rem;
  left: 50%;
  transform: translateX(-50%);
  width: 28%;
  min-width: 4.6rem;
  max-width: 6.2rem;
  height: 1.55rem;
  border-radius: 999px;
  background: #000;
  z-index: 6;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

.landing-phone-demo__island-cam {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 35%, #2a3344 0%, #0a0c10 55%, #000 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 0 3px rgba(80, 120, 200, 0.25);
}

.landing-phone-demo__statusbar {
  flex-shrink: 0;
  height: 2.35rem;
  padding: 0.72rem 1.15rem 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 5;
}

.landing-phone-demo__status-time {
  font-variant-numeric: tabular-nums;
}

.landing-phone-demo__status-icons {
  display: flex;
  align-items: center;
  gap: 0.28rem;
}

.landing-phone-demo__status-signal {
  width: 0.95rem;
  height: 0.55rem;
  background:
    linear-gradient(to top, #f8fafc 0 100%) 0 100% / 0.16rem 35% no-repeat,
    linear-gradient(to top, #f8fafc 0 100%) 0.28rem 100% / 0.16rem 55% no-repeat,
    linear-gradient(to top, #f8fafc 0 100%) 0.56rem 100% / 0.16rem 75% no-repeat,
    linear-gradient(to top, #f8fafc 0 100%) 0.84rem 100% / 0.16rem 100% no-repeat;
  opacity: 0.95;
}

.landing-phone-demo__status-wifi {
  width: 0.72rem;
  height: 0.55rem;
  border: 2px solid transparent;
  border-top-color: #f8fafc;
  border-radius: 50% 50% 0 0;
  transform: scale(0.85) rotate(0deg);
  opacity: 0.9;
}

.landing-phone-demo__status-battery {
  width: 1.15rem;
  height: 0.52rem;
  border: 1.5px solid rgba(248, 250, 252, 0.85);
  border-radius: 0.18rem;
  position: relative;
}

.landing-phone-demo__status-battery::before {
  content: "";
  position: absolute;
  inset: 0.1rem 0.12rem;
  border-radius: 0.08rem;
  background: #f8fafc;
}

.landing-phone-demo__status-battery::after {
  content: "";
  position: absolute;
  right: -0.22rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.1rem;
  height: 0.22rem;
  border-radius: 0 1px 1px 0;
  background: rgba(248, 250, 252, 0.75);
}

.landing-phone-demo__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0.85rem 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(12, 14, 22, 0.96);
}

.landing-phone-demo__avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff7ed;
  background: linear-gradient(135deg, #ea580c, #f97316);
  box-shadow:
    0 0 0 1px rgba(249, 115, 22, 0.4),
    0 4px 12px -4px rgba(249, 115, 22, 0.55);
  flex-shrink: 0;
}

.landing-phone-demo__name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.2;
  margin: 0;
}

.landing-phone-demo__status {
  font-size: 0.62rem;
  color: #4ade80;
  margin: 0.12rem 0 0;
  line-height: 1;
}

.landing-phone-demo__chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.65rem 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background:
    radial-gradient(circle at 82% 12%, rgba(37, 99, 235, 0.06), transparent 38%),
    radial-gradient(circle at 12% 88%, rgba(249, 115, 22, 0.07), transparent 42%),
    linear-gradient(180deg, #0a0c12 0%, #06070b 100%);
  scrollbar-width: none;
}

.landing-phone-demo__chat::-webkit-scrollbar {
  display: none;
}

.landing-phone-demo__msg-row {
  display: flex;
  align-items: flex-end;
  gap: 0.38rem;
  max-width: 92%;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  animation: landing-phone-msg-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.landing-phone-demo__msg-row--bot {
  align-self: flex-start;
}

.landing-phone-demo__msg-row--them {
  align-self: flex-end;
}

.landing-phone-demo__msg-row--stacked {
  margin-top: -0.05rem;
}

.landing-phone-demo__msg-row--stacked.landing-phone-demo__msg-row--bot {
  padding-left: 2.55rem;
}

.landing-phone-demo__msg-row--stacked.landing-phone-demo__msg-row--them {
  padding-right: 2.55rem;
}

.landing-phone-demo__msg-avatar {
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 999px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.28);
}

.landing-phone-demo__msg-avatar--bot {
  color: #fff7ed;
  background: linear-gradient(145deg, #fb923c, #ea580c);
}

.landing-phone-demo__msg-avatar--them {
  padding: 0;
  overflow: hidden;
  background: #1e293b;
}

.landing-phone-demo__msg-avatar-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.landing-phone-demo__msg-avatar-icon {
  width: 0.82rem;
  height: 0.82rem;
  display: block;
}

.landing-phone-demo__msg {
  position: relative;
  max-width: 100%;
  flex: 0 1 auto;
  padding: 0.48rem 0.72rem;
  font-size: 0.72rem;
  line-height: 1.42;
  letter-spacing: 0.01em;
  word-break: break-word;
}

.landing-phone-demo__msg-text {
  display: block;
}

.landing-phone-demo__msg--stacked {
  margin-top: 0;
}

.landing-phone-demo__msg--them {
  color: #f8fafc;
  font-weight: 500;
  background: linear-gradient(155deg, #2f6fd6 0%, #2563eb 48%, #1d4ed8 100%);
  border-radius: 1.15rem 1.15rem 0.32rem 1.15rem;
  box-shadow:
    0 2px 10px rgba(29, 78, 216, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.landing-phone-demo__msg--bot {
  color: #fffbeb;
  font-weight: 500;
  background: linear-gradient(155deg, #fb923c 0%, #f97316 45%, #ea580c 100%);
  border-radius: 1.15rem 1.15rem 1.15rem 0.32rem;
  box-shadow:
    0 3px 14px rgba(249, 115, 22, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.landing-phone-demo__footer-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2.55rem;
  z-index: 4;
  display: flex;
  justify-content: center;
  padding: 0 0.55rem;
  pointer-events: none;
}

.landing-phone-demo--half .landing-phone-demo__footer-status {
  /* 8/19.2 = fração visível do aparelho com aspect 9/8 sobre tela 9/19.2 */
  top: calc(100% * 8 / 19.2 - 1.35rem - 0.65cm);
  bottom: auto;
}

.landing-phone-demo__footer-status[hidden] {
  display: none !important;
}

.landing-phone-demo__status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  max-width: 100%;
  padding: 0.38rem 0.72rem;
  font-size: 0.58rem;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(203, 213, 225, 0.92);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: landing-phone-footer-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.landing-phone-demo__msg-dot {
  flex-shrink: 0;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.22);
}

.landing-phone-demo__msg-system-text {
  flex: 1;
  min-width: 0;
}

.landing-phone-demo__typing {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.28rem;
  margin: 0 0.6rem 0.35rem;
  padding: 0.4rem 0.52rem;
  width: fit-content;
  border-radius: 1.15rem 1.15rem 1.15rem 0.32rem;
  background: rgba(30, 41, 59, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.landing-phone-demo__typing[hidden] {
  display: none !important;
}

.landing-phone-demo__typing span {
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.85);
  animation: landing-phone-typing 1.1s ease-in-out infinite;
}

.landing-phone-demo__typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.landing-phone-demo__typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.landing-phone-demo__input {
  flex-shrink: 0;
  margin: 0 0.55rem 0.35rem;
  padding: 0.38rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6rem;
  color: rgba(100, 116, 139, 0.95);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.landing-phone-demo__home-indicator {
  flex-shrink: 0;
  width: 32%;
  height: 0.22rem;
  margin: 0 auto 0.42rem;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.88);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

@keyframes landing-phone-msg-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes landing-phone-footer-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes landing-phone-typing {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-phone-demo__msg-row {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .landing-phone-demo__msg {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .landing-phone-demo__status-pill {
    animation: none;
  }

  .landing-phone-demo__typing span {
    animation: none;
    opacity: 0.7;
  }
}
