:root {
  --wa-green: #25d366;
  --wa-green-dark: #0a7f43;
  --ink: #111b21;
  --muted: #667781;
  --line: #e8edef;
  --surface: #ffffff;
  --footer: #0b171d;
  --guide: #ffffff;
  --guide-ink: #10251a;
  --accent: #ff4967;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #e8eeeb; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #e8eeeb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

.invite-page {
  width: min(100%, 480px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--surface);
  box-shadow: 0 0 42px rgba(12, 34, 23, 0.09);
}

.wa-header {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  min-height: 92px;
  padding: 14px 18px;
}

.menu-icon { display: grid; gap: 6px; width: 44px; padding: 12px 7px; }
.menu-icon i { display: block; width: 30px; height: 3px; border-radius: 3px; background: var(--ink); }

.wa-wordmark { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--wa-green); font-size: clamp(24px, 7vw, 30px); font-weight: 700; letter-spacing: -0.04em; }
.wa-wordmark svg { width: 38px; fill: currentColor; }

.download-icon { display: grid; width: 44px; height: 44px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--wa-green); }
.download-icon svg, .footer-download svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.invitation { display: flex; min-height: 680px; flex-direction: column; align-items: center; padding: 62px 24px 76px; text-align: center; }
.trip-avatar { width: 104px; height: 104px; overflow: hidden; border: 4px solid #fff; border-radius: 50%; box-shadow: 0 9px 24px rgba(17, 27, 33, 0.16); }
.trip-avatar svg { display: block; width: 100%; height: 100%; }

.invite-kicker { display: none; margin: 26px 0 8px; color: var(--wa-green-dark); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.invitation h1 { max-width: 390px; margin: 28px 0 6px; font-size: clamp(25px, 7.2vw, 34px); font-weight: 400; line-height: 1.2; letter-spacing: -0.035em; text-wrap: balance; }
.group-name { margin: 0 0 26px; font-size: clamp(26px, 7.4vw, 35px); line-height: 1.18; letter-spacing: -0.035em; }

.group-pill { display: inline-flex; width: min(100%, 330px); min-height: 60px; align-items: center; justify-content: center; gap: 10px; padding: 0 20px; border: 2px solid var(--ink); border-radius: 999px; color: var(--ink); background: var(--wa-green); box-shadow: 0 10px 22px rgba(37, 211, 102, 0.2); font-size: clamp(16px, 4.8vw, 19px); font-weight: 700; text-decoration: none; transition: filter 160ms ease, box-shadow 160ms ease; }
.group-pill:hover { filter: brightness(1.03); box-shadow: 0 13px 27px rgba(37, 211, 102, 0.28); }
.group-pill:active { filter: brightness(0.9); }
.group-pill svg { width: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.join-area { display: grid; width: min(100%, 360px); gap: 8px; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); color: #6c6c6c; font-size: 20px; }
.join-link { width: max-content; margin: 0 auto; border-bottom: 3px solid var(--wa-green); color: var(--ink); font-size: 20px; font-weight: 600; text-decoration: none; }

.continue-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.wa-footer { padding: 50px 24px 46px; color: #fff; background: var(--footer); }
.footer-download { display: flex; width: min(100%, 320px); min-height: 64px; align-items: center; justify-content: center; gap: 12px; margin: 0 auto 42px; border-radius: 999px; color: var(--ink); background: var(--wa-green); font-size: 20px; font-weight: 650; }
.social-row { display: flex; justify-content: space-between; border-top: 1px solid #334249; padding-top: 30px; }
.social-row span { display: grid; width: 46px; height: 46px; place-items: center; border: 2px solid #fff; border-radius: 50%; }
.social-row svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.social-row .fill-icon { fill: currentColor; stroke: none; }

.guide-overlay { position: fixed; inset: 0; z-index: 50; overflow-y: auto; padding: max(52px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); background: rgba(2, 14, 8, 0.68); backdrop-filter: blur(2.5px); }
.guide-card { position: relative; width: min(100%, 430px); margin: 0 auto; padding: 24px; border-radius: 26px; color: var(--guide-ink); background: var(--guide); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32); animation: card-in 360ms cubic-bezier(.22, .8, .28, 1) both; }

.target-arrow { position: absolute; top: -54px; right: 12px; width: 92px; height: 72px; pointer-events: none; }
.target-arrow svg { position: absolute; inset: 0; width: 100%; overflow: visible; }
.target-arrow path { fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.dots-pulse { position: absolute; top: -7px; right: -3px; display: flex; width: 46px; height: 46px; align-items: center; justify-content: center; gap: 3px; border: 3px solid var(--accent); border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255, 73, 103, 0.55); animation: beacon 1.7s ease-out infinite; }
.dots-pulse i { width: 4px; height: 4px; border-radius: 50%; background: #111; }

.guide-progress { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 20px; }
.guide-progress span, .guide-progress i { height: 4px; border-radius: 99px; }
.guide-progress span { background: var(--wa-green); }
.guide-progress i { background: #dfe7e2; }
.guide-eyebrow { margin: 0 0 8px; color: var(--wa-green-dark); font-size: 12px; font-weight: 800; letter-spacing: 0.12em; }
.guide-card h2 { margin: 0; font-size: clamp(28px, 8vw, 36px); line-height: 1.08; letter-spacing: -0.045em; outline: none; text-wrap: balance; }
.guide-copy { margin: 12px 0 20px; color: #5b6a62; font-size: 16px; line-height: 1.5; }
.guide-copy strong { color: var(--guide-ink); }

.next-step { display: grid; grid-template-columns: 38px 1fr 24px; align-items: center; gap: 12px; margin-bottom: 20px; padding: 13px; border: 1px solid #cfe7d8; border-radius: 16px; background: #f0fbf4; }
.step-check { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: #fff; background: var(--wa-green-dark); font-size: 14px; font-weight: 800; }
.next-step > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.next-step small { color: #647269; font-size: 12px; }
.next-step strong { font-size: 14px; }
.next-step > svg { width: 22px; fill: none; stroke: var(--wa-green-dark); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.continue-button { display: flex; width: 100%; min-height: 58px; align-items: center; justify-content: center; gap: 10px; padding: 0 18px; border: 0; border-radius: 16px; color: #071a10; background: var(--wa-green); box-shadow: 0 10px 24px rgba(23, 152, 76, 0.24); cursor: pointer; font-size: 16px; font-weight: 800; transition: filter 160ms ease, box-shadow 160ms ease, background-color 160ms ease, color 160ms ease; }
.continue-button:not(:disabled):hover { filter: brightness(1.03); box-shadow: 0 13px 28px rgba(23, 152, 76, 0.3); }
.continue-button:not(:disabled):active { filter: brightness(0.91); }
.continue-button:disabled { color: #617068; background: #dce7df; box-shadow: none; cursor: not-allowed; }
.continue-button:disabled svg { opacity: 0.42; }

.unlock-feedback { display: grid; gap: 7px; padding: 10px 4px 2px; }
.unlock-copy { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #617068; font-size: 12px; font-weight: 650; }
.unlock-copy strong { min-width: 34px; color: var(--wa-green-dark); font-size: 12px; text-align: right; }
.unlock-track { height: 4px; overflow: hidden; border-radius: 999px; background: #e3ebe6; }
.unlock-track span { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--wa-green); transform: scaleX(0); transform-origin: left center; transition: transform 220ms linear; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; margin: -1px; padding: 0; border: 0; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.copy-button { display: flex; width: 100%; min-height: 48px; align-items: center; justify-content: center; gap: 7px; margin-top: 4px; border: 0; border-radius: 12px; color: #607068; background: transparent; cursor: pointer; font-size: 13px; font-weight: 700; }
.copy-button:hover { background: #f3f7f4; color: var(--guide-ink); }
.copy-button:active { background: #e8f0eb; }
.copy-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.continue-button:focus-visible, .copy-button:focus-visible, .join-link:focus-visible, .group-pill:focus-visible { outline: 3px solid rgba(37, 211, 102, 0.5); outline-offset: 3px; }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 80; padding: 11px 17px; border-radius: 999px; color: #fff; background: #0b1e14; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25); font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

body[data-browser="external"] .guide-overlay { display: none; }
body[data-browser="external"] .invite-kicker { display: flex; }
body[data-browser="external"] .invitation { min-height: calc(100dvh - 92px); justify-content: center; padding-top: 32px; }
body[data-browser="external"] .wa-footer { display: none; }

@keyframes card-in { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 rgba(255, 73, 103, .65); } 70%, 100% { box-shadow: 0 0 0 12px rgba(255, 73, 103, 0); } }

@media (min-width: 720px) {
  .guide-overlay { display: grid; place-items: start center; padding-top: 96px; }
  .guide-card { padding: 28px; }
  .target-arrow { top: -70px; right: 0; }
}

@media (max-height: 620px) and (orientation: landscape) {
  .guide-overlay { padding-top: 34px; }
  .guide-card { max-width: 560px; padding: 18px 22px; }
  .target-arrow { top: -37px; transform: scale(.72); transform-origin: right bottom; }
  .guide-progress { margin-bottom: 12px; }
  .guide-card h2 { font-size: 26px; }
  .guide-copy { margin-block: 8px 12px; }
  .next-step { margin-bottom: 12px; padding: 9px 12px; }
  .continue-button { min-height: 50px; }
  .unlock-feedback { padding-top: 7px; }
  .copy-button { min-height: 42px; }
}

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