/* Travenza · page-plan.css — responsive layout for page-plan.php ("Plan My Trip").
   Uses the shared tokens/utilities from style.css (--gutter, --section-y, --radius-card, --f-display…).

   Structure: 1 tokens · 2 hero · 3 form (grouped cards, fields, chips, submit) · 4 WhatsApp band · 5 status toast
   Breakpoints: 820 (tablet portrait) · 560 (phones) · 400 (small phones). */

/* ───────────────────────── 1. Tokens ───────────────────────── */
.plan-page {
  --plan-y: clamp(48px, 6vw, 88px);
  --plan-muted: #5e5e57;                  /* AA body-copy grey on white / ivory */
  --plan-line: var(--gray-light, #e0ded6);
  display: block;
}

/* ───────────────────────── 2. Hero ─────────────────────────
   The global .reveal hides its element until main.js marks it visible: keep the page readable if JS is off,
   and show the hero after 3s if the observer never fires. */
html:not(.js) .plan-page .reveal { opacity: 1; transform: none; }
/* style.css (<=560px) re-applies the hidden-state offset to revealed elements (same specificity, later in the file), leaving every
   revealed .reveal 16px low on phones: force the settled state. */
.js .reveal.visible, .js .reveal-left.visible, .js .reveal-right.visible { transform: none; }
.plan-hero .reveal:not(.visible) { animation: planRevealFallback .6s ease 3s forwards; }
@keyframes planRevealFallback { to { opacity: 1; transform: none; } }

.plan-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center;
  min-height: clamp(420px, 56vh, 620px);
  min-height: clamp(420px, 56svh, 620px);
  padding: calc(var(--nav-h, 72px) + clamp(40px, 7vw, 88px)) var(--gutter) clamp(48px, 6vw, 80px);
  background: var(--dark-green);
}
@media (max-height: 520px) and (orientation: landscape) {
  .plan-hero { min-height: 0; padding-top: calc(var(--nav-h, 72px) + 24px); padding-bottom: 32px; }
}
.plan-hero__glow {
  position: absolute; z-index: -1; top: -30%; right: -8%;
  width: min(62vw, 760px); aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(213,142,74,.16) 0%, transparent 70%);
}
.plan-hero__inner { width: 100%; max-width: var(--container, 1200px); margin-inline: auto; }
.plan-hero__copy { min-width: 0; }
/* "What happens next" card: only where the wide hero would otherwise be empty on the right */
.plan-next { display: none; }
@media (min-width: 1000px) {
  .plan-hero__inner { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); align-items: center; gap: clamp(40px, 6vw, 96px); }
  .plan-next { display: block; padding: clamp(24px, 2.4vw, 34px); border-radius: 22px; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.22); box-shadow: 0 18px 50px rgba(0,0,0,.16); }
}
.plan-next__title { font-family: var(--f-display); font-weight: 900; font-size: clamp(22px, 1.4vw + 12px, 28px); line-height: 1.2; color: #fff; margin: 0 0 20px; }
.plan-next__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; counter-reset: none; }
.plan-next__list li { display: flex; align-items: flex-start; gap: 14px; }
.plan-next__num {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--orange-pale); color: var(--orange-ink); font: 700 14px/1 var(--f-body);
}
.plan-next__step { min-width: 0; font-size: 14.5px; line-height: 1.55; color: rgba(255,255,255,.84); text-wrap: pretty; }
.plan-next__step strong { display: block; font-size: 16px; font-weight: 700; line-height: 1.35; color: #fff; margin-bottom: 2px; }
.plan-next__foot { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.2); font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,.78); }
.plan-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,.72); margin: 0 0 20px; }
.plan-h1 {
  font-family: var(--f-display); font-weight: 900; color: #fff;
  font-size: clamp(42px, 7.4vw + 14px, 108px); line-height: 1.08; letter-spacing: -.02em;
  margin: 0 0 24px;
}
.plan-h1 em { color: var(--orange); font-style: italic; }
.plan-lede { font-size: clamp(16px, .5vw + 14.5px, 18px); line-height: 1.65; font-weight: 300; color: rgba(255,255,255,.84); max-width: 50ch; margin: 0; text-wrap: pretty; }

/* ───────────────────────── 3. Form ───────────────────────── */
.plan-formsec { background: var(--ivory); padding: var(--plan-y) var(--gutter); }
.plan-formsec__wrap { max-width: 820px; margin-inline: auto; }
.plan-formsec .plan-heading { max-width: none; font-size: clamp(30px, 3.4vw + 12px, 56px); margin-bottom: clamp(28px, 4vw, 40px); }

.plan-form { display: flex; flex-direction: column; gap: clamp(16px, 2.4vw, 24px); }

/* three grouped cards: details · trip · style */
.plan-group {
  display: flex; flex-direction: column; gap: clamp(16px, 2.4vw, 22px);
  background: #fff; border: 1px solid var(--plan-line); border-radius: var(--radius-card, 20px);
  padding: clamp(20px, 4vw, 34px);
  box-shadow: 0 8px 30px rgba(40,30,10,.05);
}
.plan-group__title {
  display: flex; align-items: center; gap: 12px; margin: 0 0 2px;
  font-family: var(--f-display); font-weight: 900; font-size: clamp(19px, 1vw + 16px, 24px); line-height: 1.2; color: var(--black);
}
.plan-group__num {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--orange-pale); color: var(--orange); font: 700 14px/1 var(--f-body);
}

.plan-row { display: grid; gap: clamp(14px, 2vw, 18px); }
.plan-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plan-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plan-field--wide { grid-column: 1 / -1; }
/* a failed submit scrolls the first invalid field into view: keep its label clear of the fixed header */
.plan-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; scroll-margin-top: calc(var(--nav-h, 72px) + 24px); scroll-margin-bottom: 24px; }
.plan-label { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--plan-muted); line-height: 1.35; }
/* Adults · Children · Infants: age range sits on its own line; every label reserves two lines so the three inputs align */
.plan-label__sub { display: block; font-size: 12px; font-weight: 500; letter-spacing: .2px; text-transform: none; color: #6b6b64; }
.plan-row--3 .plan-label { min-height: 2.7em; }
.plan-err { margin: 0; font-size: 13px; line-height: 1.45; font-weight: 500; color: #b3261e; }

.plan-input {
  display: block; width: 100%; min-height: 52px; padding: 14px 16px;
  border: 1.5px solid var(--plan-line); border-radius: 12px;
  background: var(--ivory-2); color: var(--black);
  font: 400 16px/1.4 var(--f-body); text-align: left;
  -webkit-appearance: none; appearance: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.plan-input::placeholder { color: #8c8c84; opacity: 1; }
.plan-input:focus { outline: none; border-color: var(--orange); background-color: #fff; box-shadow: 0 0 0 4px rgba(213,142,74,.2); }
.plan-field.is-invalid .plan-input { border-color: #b3261e; background-color: #fff8f7; }
.plan-field.is-invalid .plan-input:focus { box-shadow: 0 0 0 4px rgba(179,38,30,.14); }
.plan-textarea { min-height: 128px; resize: vertical; }

/* number inputs: a calm stepper on desktop, plain numeric keypad field on phones */
.plan-input--count { -moz-appearance: textfield; appearance: textfield; }

/* experience-type chips: real checkboxes stay in the DOM (focusable, screen-reader friendly), the pill is the visual */
.plan-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.plan-chip { position: relative; display: inline-flex; }
.plan-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.plan-chip span {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 22px; width: 100%;
  border: 1.5px solid var(--plan-line); border-radius: 999px; background: var(--ivory-2);
  font-size: 15px; font-weight: 600; color: var(--black-soft); line-height: 1.2;
  transition: background-color .2s, border-color .2s, color .2s, transform .15s;
}
.plan-chip span::before {
  content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid #b5b3a8; background: #fff center / 11px no-repeat; transition: background-color .2s, border-color .2s;
}
.plan-chip:hover span { border-color: var(--orange); }
.plan-chip input:checked + span { background: var(--orange-pale); border-color: var(--orange); color: var(--black); }
.plan-chip input:checked + span::before {
  border-color: var(--orange); background-color: var(--orange);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6.4l2.3 2.3 4.7-5' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.plan-chip input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 3px; }
.plan-chip:active span { transform: scale(.98); }

/* submit */
.plan-submitwrap { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding-top: 4px; }
.plan-submit { width: 100%; justify-content: center; min-height: 54px; padding: 16px 28px; font-size: 15px; font-family: inherit; }
.plan-submit:disabled { opacity: .7; cursor: progress; transform: none; }
.plan-fine { font-size: 13px; line-height: 1.55; color: var(--plan-muted); text-align: center; margin: 0; }

@media (max-width: 560px) {
  .plan-row--2 { grid-template-columns: minmax(0, 1fr); }
  .plan-row--3 { gap: 10px; }
  .plan-row--3 .plan-label { font-size: 11px; letter-spacing: .6px; }
  .plan-row--3 .plan-label__sub { font-size: 11px; letter-spacing: 0; }
  .plan-input--count { padding-inline: 8px; text-align: center; }
  .plan-input--count::-webkit-inner-spin-button, .plan-input--count::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
  .plan-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-chip span { padding-inline: 12px; }
}
@media (max-width: 400px) {
  .plan-group { padding: 18px 16px; }
}

/* ───────────────────────── 4. WhatsApp band ───────────────────────── */
.plan-cta { background: var(--dark-green); text-align: center; padding: clamp(56px, 6vw, 88px) var(--gutter); }
.plan-cta__inner { max-width: 640px; margin-inline: auto; }
.plan-cta__eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,.72); margin: 0 0 18px; }
.plan-cta__title { font-family: var(--f-display); font-weight: 900; color: #fff; font-size: clamp(30px, 2.4vw + 18px, 48px); line-height: 1.15; margin: 0 0 16px; }
.plan-cta__text { font-size: clamp(15px, .3vw + 14px, 17px); line-height: 1.6; color: rgba(255,255,255,.84); margin: 0 0 32px; }
.plan-cta__btn { font-size: 16px; min-height: 56px; justify-content: center; }
@media (max-width: 560px) { .plan-cta__btn { width: 100%; max-width: 360px; } }

/* ───────────────────────── 5. Form status toast ─────────────────────────
   .tr-notice is injected by inc/trip-requests.php (fixed, left:50% + translateX(-50%)), which makes the
   box shrink to half the viewport on phones and leaves it tappable after it fades. Harden it here. */
body .tr-notice#trNotice {
  width: max-content; max-width: min(580px, calc(100vw - 32px)); box-sizing: border-box;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  padding: 14px 20px; font-size: 15px; line-height: 1.45;
  animation: slideUp .5s ease, planNoticeGone 0s linear 5.4s forwards;
}
@keyframes planNoticeGone { to { visibility: hidden; pointer-events: none; } }
