/* Hub tablet — landscape or portrait, touch-first */

.app {
  position: relative;
  width: 100%;
  /* 100dvh handles the collapsing address bar on Android/iOS correctly —
     `position: fixed; inset: 0` was rendering the whole app at 0 height
     on Samsung Chrome / Samsung Internet. Fallback to vh for older UAs. */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: clamp(24px, 4vw, 56px);
  animation: fade .35s ease;
}

.screen.is-active { display: flex; }

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Wordmark size for the welcome screen ----------
   Use min() so the CoRo wordmark is bounded by whichever viewport
   dimension is smaller — on a landscape tablet with limited height,
   vh caps it; in portrait, vw caps it. Prevents overflow on any tablet
   without device-specific tweaking.  */

.wordmark--big {
  font-size: min(20vw, 26vh, 220px);
  max-width: 100%;
}

/* ---------- Welcome ---------- */

.screen--welcome {
  background:
    radial-gradient(ellipse at 15% 10%, rgba(224, 248, 72, 0.35), transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(112, 24, 80, 0.10), transparent 60%),
    var(--bg);
  align-items: center;
  justify-content: space-between;
}

.welcome__brand {
  margin-top: clamp(24px, 6vh, 120px);
  text-align: center;
  max-width: 100%;
}

.tagline {
  margin-top: clamp(10px, 1.6vh, 22px);
  font-size: clamp(14px, min(2.4vw, 2.6vh), 24px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 700;
}

.welcome__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-mute);
  font-size: clamp(14px, 1.6vw, 16px);
  margin-bottom: 12px;
  font-weight: 600;
}

.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(47, 133, 88, 0.15);
  animation: pulse 2.4s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--brand);
  color: #fdfaf2;
  box-shadow: var(--shadow);
}

.btn--primary[disabled] {
  background: var(--line);
  color: #fff;
  box-shadow: none;
  cursor: not-allowed;
}

.btn--primary:not([disabled]):hover { background: var(--brand-deep); }

.btn--huge {
  font-size: clamp(22px, min(3.6vw, 4.4vh), 40px);
  padding: clamp(18px, min(3vw, 3.6vh), 34px) clamp(36px, 7vw, 96px);
  margin-bottom: clamp(20px, 5vh, 80px);
  max-width: calc(100% - 32px);
}

.btn--wide {
  font-size: clamp(20px, 2.6vw, 26px);
  padding: clamp(20px, 3vw, 28px) clamp(40px, 6vw, 64px);
  width: 100%;
  max-width: 560px;
}

.btn--small {
  font-size: 16px;
  padding: 12px 22px;
}

.btn--ghost {
  color: var(--brand);
  background: transparent;
  padding: 14px 22px;
  font-weight: 700;
}

.btn--ghost:hover { background: var(--brand-tint); }

/* ---------- Address / keypad ---------- */

.screen--address {
  background: var(--bg);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-bottom: 12px;
}

.topbar__title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  text-align: center;
  color: var(--ink);
}

.topbar__spacer { width: 1px; }

.address {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 4vh, 48px);
  padding-top: 12px;
}

.address__preview {
  display: inline-flex;
  align-items: baseline;
  gap: clamp(12px, 1.6vw, 20px);
  padding: clamp(20px, 3vw, 32px) clamp(28px, 4vw, 48px);
  background: var(--bg-elev);
  border: 2px solid var(--line);
  border-radius: 22px;
  min-width: min(560px, 90vw);
  justify-content: center;
  box-shadow: var(--shadow);
}

.address__number {
  font-size: clamp(48px, 8vw, 84px);
  font-weight: 900;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  min-width: 1.5ch;
  text-align: right;
}

.address__number[data-placeholder]:empty::before,
.address__number.is-empty::before {
  content: attr(data-placeholder);
  color: var(--line);
}

.address__estate {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  color: var(--ink-mute);
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 1.6vw, 18px);
  width: min(520px, 92vw);
}

.key {
  aspect-ratio: 1.6 / 1;
  background: var(--bg-elev);
  border: 2px solid var(--line);
  border-radius: 20px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s ease, transform .08s ease, border-color .1s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}

.key:active {
  background: var(--brand-tint);
  border-color: var(--brand);
  transform: scale(0.97);
}

.key--util {
  background: transparent;
  border-color: transparent;
  color: var(--ink-mute);
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 700;
}

.key--util:active { background: var(--coral-tint); color: var(--coral); }

/* ---------- Waiting ---------- */

.screen--waiting {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(112, 24, 80, 0.06), transparent 60%),
    var(--bg);
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.waiting {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 640px;
  color: var(--brand);
}

.waiting__spinner {
  animation: spin 1.6s linear infinite;
  transform-origin: center;
  display: inline-flex;
}

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

.waiting__title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  color: var(--ink);
}

.waiting__body {
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--ink-mute);
  font-weight: 700;
}

.waiting__body strong {
  color: var(--brand);
  font-weight: 900;
}

/* ---------- Ready ---------- */

.screen--ready {
  background: linear-gradient(140deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fdfaf2;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(20px, 3vh, 36px);
}

.ready { max-width: 900px; }

.ready__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: clamp(14px, 1.6vw, 16px);
  color: rgba(253, 250, 242, 0.7);
  font-weight: 700;
}

.ready__eyebrow span { color: var(--lime); font-weight: 900; }

.ready__title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: clamp(16px, 2vh, 24px) 0;
}

.ready__arrow {
  color: var(--lime);
  width: min(700px, 82vw);
  animation: nudge 1.4s ease-in-out infinite;
}

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(14px); }
}

.ready__door {
  font-size: clamp(20px, 2.6vw, 26px);
  color: rgba(253, 250, 242, 0.85);
  margin-top: clamp(8px, 1.2vh, 16px);
  font-weight: 600;
}

.ready .btn--primary {
  background: var(--lime);
  color: var(--brand-deep);
  margin-top: clamp(20px, 3vh, 32px);
}

.ready .btn--primary:hover { background: var(--lime-deep); }

/* ---------- Thanks (post-collection) ---------- */

.screen--thanks {
  background: var(--bg);
  align-items: center;
  justify-content: center;
}

.thanks {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  max-width: 620px;
  color: var(--ink);
}

.thanks__badge { color: var(--ok); }
.thanks__badge--pop { color: var(--lime); animation: pop .5s ease; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.thanks__title {
  font-size: clamp(30px, 4.4vw, 48px);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.thanks__body {
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--ink-mute);
  font-weight: 700;
}

.thanks__body strong { color: var(--brand); font-weight: 900; }

/* ---------- Survey ---------- */

.screen--survey,
.screen--survey-done {
  background:
    radial-gradient(ellipse at 12% 8%, rgba(224, 248, 72, 0.30), transparent 55%),
    var(--bg);
  align-items: center;
  justify-content: center;
}

.survey {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 4vh, 40px);
  max-width: 1080px;
  width: 100%;
}

.survey__step {
  color: var(--ink-mute);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.survey__title {
  font-size: clamp(26px, 3.8vw, 40px);
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 900px;
}

.faces {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(10px, 1.6vw, 18px);
  width: min(960px, 94vw);
}

.face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: clamp(16px, 2.4vw, 24px) 12px;
  background: var(--bg-elev);
  border: 2px solid var(--line);
  border-radius: 22px;
  color: var(--brand);
  transition: transform .1s ease, border-color .1s ease, background .1s ease, color .1s ease;
}

.face svg { width: clamp(56px, 8vw, 88px); height: auto; }

.face span {
  font-size: clamp(13px, 1.4vw, 16px);
  color: var(--ink-mute);
  font-weight: 700;
}

.face:hover, .face:active {
  border-color: var(--brand);
  background: var(--brand-tint);
  transform: translateY(-3px);
}

.face:active { transform: scale(0.97); }

.choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2vw, 22px);
  width: min(820px, 94vw);
}

.choice {
  padding: clamp(28px, 4vw, 44px) 12px;
  background: var(--bg-elev);
  border: 2px solid var(--line);
  border-radius: 22px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-weight: 800;
  font-size: clamp(20px, 2.4vw, 26px);
  transition: transform .1s ease, border-color .1s ease, background .1s ease;
}

.choice__glyph { font-size: clamp(40px, 6vw, 60px); line-height: 1; }

.choice:hover, .choice:active {
  border-color: var(--brand);
  background: var(--brand-tint);
  transform: translateY(-3px);
}

.choice:active { transform: scale(0.97); }

.choice--no:hover, .choice--no:active {
  border-color: var(--coral);
  background: var(--coral-tint);
}

.choice--maybe:hover, .choice--maybe:active {
  border-color: var(--lime-deep);
  background: var(--lime-tint);
}

.survey__pips {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.pip {
  width: 32px;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}

.pip.is-current { background: var(--brand); }
.pip.is-done    { background: var(--brand-tint); border: 1px solid var(--brand); }
