:root {
  color-scheme: light;
  --bg: #fbf7f5;
  --ink: #231a1c;
  --muted: #706669;
  --soft: rgba(255, 255, 255, 0.68);
  --soft-strong: rgba(255, 255, 255, 0.86);
  --line: rgba(99, 50, 61, 0.13);
  --accent: #8d273a;
  --accent-2: #b85b68;
  --accent-soft: #f5dfe3;
  --shadow: 0 24px 70px rgba(76, 45, 48, 0.13);
  --card-shadow: 0 18px 44px rgba(93, 55, 62, 0.11);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  font-family: Inter, Poppins, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(141, 39, 58, 0.08), transparent 34%),
    linear-gradient(0deg, rgba(116, 127, 119, 0.08), transparent 42%),
    var(--bg);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    linear-gradient(120deg, transparent 0 18%, rgba(141, 39, 58, 0.055) 18% 18.4%, transparent 18.4% 100%),
    linear-gradient(132deg, transparent 0 63%, rgba(45, 72, 82, 0.06) 63% 63.35%, transparent 63.35% 100%);
  pointer-events: none;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image: linear-gradient(rgba(35, 26, 28, 0.035) 1px, transparent 1px);
  background-size: 100% 96px;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 78%, transparent);
  pointer-events: none;
}

button {
  font: inherit;
}

.page-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(18px + var(--safe-top)) calc(16px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(16px + var(--safe-left));
  place-items: center;
}

.invite-app {
  position: relative;
  width: min(100%, 430px);
  height: calc(100svh - 36px - var(--safe-top) - var(--safe-bottom));
  min-height: 720px;
  max-height: 852px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.48)),
    linear-gradient(145deg, rgba(141, 39, 58, 0.08), transparent 58%),
    rgba(251, 247, 245, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 8vh, 66px) 24px 24px;
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  pointer-events: none;
  transition: opacity 600ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.screen.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.screen-content {
  position: relative;
  z-index: 1;
}

.center-content {
  display: grid;
  align-content: center;
  flex: 1;
}

.brand-mark {
  position: absolute;
  top: 28px;
  left: 24px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 10px 26px rgba(111, 69, 75, 0.1);
}

.brand-mark span {
  width: 15px;
  height: 15px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: inset 6px 0 0 var(--accent-soft);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 740;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.04;
}

h1 {
  max-width: 10.8ch;
  font-size: clamp(2.7rem, 14vw, 4.25rem);
}

h2 {
  font-size: clamp(2.1rem, 9.6vw, 3.4rem);
}

.screen-plan h2 {
  font-size: clamp(2.25rem, 10vw, 3.2rem);
}

.soft-title {
  max-width: 9ch;
}

.lead {
  max-width: 29ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.55;
}

.screen-actions {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
  width: 100%;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 56px;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 730;
  letter-spacing: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
  touch-action: manipulation;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, #7f2436, #a93f50);
  box-shadow: 0 15px 34px rgba(141, 39, 58, 0.24);
}

.secondary-button {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.primary-button svg,
.secondary-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.primary-button:active,
.secondary-button:active {
  transform: scale(0.985);
}

.primary-button:focus-visible,
.secondary-button:focus-visible {
  outline: 3px solid rgba(184, 91, 104, 0.34);
  outline-offset: 3px;
}

.footer-note {
  margin: 16px 0 0;
  color: rgba(35, 26, 28, 0.48);
  font-size: 0.82rem;
  text-align: center;
}

.intro-lines {
  display: grid;
  gap: 18px;
  margin-top: clamp(34px, 8vh, 72px);
}

.reveal-line {
  margin: 0;
  color: #34282b;
  font-size: clamp(1.35rem, 6vw, 1.9rem);
  font-weight: 560;
  line-height: 1.26;
  opacity: 0;
  transform: translateY(14px);
}

.screen-intro.is-active .reveal-line {
  animation: revealLine 760ms ease forwards;
}

.screen-intro.is-active .reveal-line:nth-child(2) {
  animation-delay: 420ms;
}

.plan-grid {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.plan-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  background: var(--soft);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(18px);
}

.card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(141, 39, 58, 0.13);
  border-radius: 16px;
  color: var(--accent);
  background: rgba(245, 223, 227, 0.58);
}

.card-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.plan-card h3 {
  margin: 0 0 8px;
  font-size: 1.01rem;
  line-height: 1.2;
}

.plan-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.48;
}

.company-note {
  margin: 18px 2px 0;
  color: #4f4245;
  font-size: 0.98rem;
  font-weight: 620;
  line-height: 1.45;
}

.choice-actions {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 12px;
  transition: opacity 260ms ease, transform 300ms ease;
}

.screen-final {
  justify-content: center;
  gap: 24px;
  padding-top: clamp(34px, 7vh, 58px);
  padding-bottom: 30px;
}

.screen-final .screen-content {
  flex: 0;
  text-align: center;
}

.screen-final h2 {
  max-width: 12ch;
  margin-inline: auto;
}

.choice-actions.is-hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.screen-final .screen-content {
  transition: opacity 320ms ease, transform 360ms ease;
}

.screen-final.has-accepted .screen-content {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.think-message {
  min-height: 48px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.42;
  text-align: center;
}

#think-button {
  transition: transform 360ms cubic-bezier(0.2, 0.9, 0.2, 1), background 220ms ease;
}

.accepted-panel {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 27%;
  display: grid;
  gap: 15px;
  padding: 26px 22px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 249, 0.72)),
    var(--soft-strong);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(18px);
  text-align: center;
  pointer-events: none;
  transition: opacity 600ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.accepted-panel::before {
  width: 42px;
  height: 4px;
  margin: 0 auto 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(141, 39, 58, 0.2), rgba(184, 91, 104, 0.52));
  content: "";
}

.accepted-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.accepted-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 760;
}

.accepted-kicker span {
  color: var(--accent-2);
}

.accepted-panel h2 {
  max-width: 14ch;
  font-size: clamp(1.7rem, 7vw, 2.35rem);
  line-height: 1.08;
}

.signature {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.whatsapp-button {
  margin-top: 2px;
}

.sparkles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.sparkles span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  opacity: 0;
  animation: sparkle 920ms ease forwards;
}

.sparkles span:nth-child(2n) {
  background: #d8a3aa;
}

@keyframes revealLine {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sparkle {
  0% {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.6);
  }

  32% {
    opacity: 0.82;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--x), var(--y), 0) scale(1);
  }
}

@media (hover: hover) {
  .primary-button:hover,
  .secondary-button:hover {
    transform: translateY(-1px);
  }

  .primary-button:hover {
    box-shadow: 0 18px 38px rgba(141, 39, 58, 0.29);
  }
}

@media (max-height: 740px) {
  .screen {
    padding-top: 24px;
  }

  h1 {
    font-size: clamp(2.35rem, 12vw, 3.35rem);
  }

  h2,
  .screen-plan h2 {
    font-size: clamp(1.85rem, 8.5vw, 2.6rem);
  }

  .lead {
    margin-top: 12px;
  }

  .plan-grid {
    gap: 10px;
    margin-top: 16px;
  }

  .plan-card {
    padding: 13px;
  }

  .plan-card p {
    font-size: 0.86rem;
  }
}

@media (min-width: 720px) {
  .page-shell {
    padding: 32px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #161113;
    --ink: #fff8f6;
    --muted: #c4b7ba;
    --soft: rgba(47, 38, 41, 0.66);
    --soft-strong: rgba(42, 33, 36, 0.88);
    --line: rgba(255, 232, 236, 0.13);
    --accent: #f0a6b0;
    --accent-2: #d66d7c;
    --accent-soft: rgba(141, 39, 58, 0.22);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
    --card-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  }

  body {
    background:
      linear-gradient(145deg, rgba(141, 39, 58, 0.18), transparent 38%),
      linear-gradient(0deg, rgba(67, 92, 95, 0.13), transparent 42%),
      var(--bg);
  }

  .invite-app {
    border-color: rgba(255, 255, 255, 0.1);
    background:
      linear-gradient(180deg, rgba(45, 36, 39, 0.86), rgba(35, 27, 30, 0.74)),
      rgba(22, 17, 19, 0.78);
  }

  .reveal-line,
  .company-note {
    color: #f4e9e7;
  }

  .secondary-button {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.08);
  }

  .brand-mark {
    background: rgba(255, 255, 255, 0.06);
  }

  .footer-note {
    color: rgba(255, 248, 246, 0.46);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .reveal-line,
  .screen,
  .accepted-panel {
    transform: none !important;
  }
}
