/* Book a Tour — lead form in a modal.
   Self-contained component: scripts/book-tour.js injects every element under
   .tour-root; no page markup is required beyond including this file and the
   script. Pages without JS simply never get the modal. */

.tour-root{font-family:'Archivo',sans-serif;color:var(--ink-900)}

/* ---------- launcher + teaser ---------- */

.tour-launcher{position:fixed;bottom:24px;right:24px;z-index:80;width:60px;height:60px;border-radius:var(--radius-pill);background:var(--rose-500);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform var(--dur-fast) var(--ease-out),background var(--dur-fast) var(--ease-out)}
.tour-launcher:hover{transform:translateY(-2px);background:var(--rose-600)}
.tour-launcher:active{transform:translateY(0) scale(.94)}
.tour-launcher:focus-visible{outline:none;box-shadow:var(--focus-ring)}
.tour-launcher svg{display:block;transition:transform var(--dur-fast) var(--ease-out)}
.tour-launcher:hover svg{transform:rotate(-8deg) scale(1.08)}

.tour-teaser{position:fixed;bottom:38px;right:96px;z-index:80;background:var(--ink-900);color:#fff;padding:10px 16px;border-radius:14px 14px 2px 14px;font-size:14px;font-weight:500;box-shadow:var(--shadow-pop)}
.tour-teaser[hidden]{display:none}

/* ---------- modal ---------- */

.tour-lock{overflow:hidden}

.tour-modal{width:min(560px,calc(100% - 32px));max-height:calc(100dvh - 32px);margin:auto;padding:clamp(24px,4vw,40px);border:none;border-radius:var(--radius-xl);background:#fff;color:var(--ink-900);box-shadow:var(--shadow-modal);overflow-y:auto;overscroll-behavior:contain}
.tour-modal::backdrop{background:rgba(18,17,18,.55)}

.tour-close{position:absolute;top:14px;right:14px;width:36px;height:36px;border:none;border-radius:var(--radius-pill);background:none;color:var(--gray-500);font-size:24px;line-height:1;cursor:pointer;transition:background var(--dur-fast) var(--ease-out),color var(--dur-fast) var(--ease-out)}
.tour-close:hover{background:var(--gray-100);color:var(--ink-900)}
.tour-close:focus-visible{outline:none;box-shadow:var(--focus-ring)}

.tour-head{margin-bottom:24px;padding-right:28px}
.tour-title{font-size:clamp(26px,3vw,32px);font-weight:700;letter-spacing:-.02em;line-height:1.08;margin:12px 0 0}
.tour-lede{font-size:15.5px;line-height:1.55;color:var(--gray-700);margin:10px 0 0}

/* ---------- form ---------- */

.tour-form{display:flex;flex-direction:column;gap:18px}
.tour-form__row{display:grid;grid-template-columns:1fr 1fr;gap:18px}
@media (max-width:560px){.tour-form__row{grid-template-columns:1fr}}
.tour-form__field{display:flex;flex-direction:column;gap:7px}
.tour-form__field > span{font-size:13.5px;font-weight:600;color:var(--ink-900)}
.tour-form__field em{font-style:normal;font-weight:400;color:var(--gray-500)}
.tour-form__field input,.tour-form__field select{font-family:inherit;font-size:15px;color:var(--ink-900);background:#fff;border:1px solid var(--gray-300);border-radius:var(--radius-sm);padding:11px 14px;transition:border-color var(--dur-fast) var(--ease-out)}
/* Chevron affordance for every browser (replaces the native triangle). */
.tour-form__field select{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A7580' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 14px center;background-size:14px;padding-right:40px}
.tour-form__field input:hover,.tour-form__field select:hover{border-color:var(--gray-500)}
.tour-form__field input:focus-visible,.tour-form__field select:focus-visible{outline:none;border-color:var(--rose-500);box-shadow:var(--focus-ring)}
/* Customizable select (Chrome/Edge 135+): restyles the native select's panel
   and options in-brand. Other browsers keep the styled-closed native control —
   pure progressive enhancement, no JS. */
@supports (appearance: base-select) {
  .tour-form__field select{appearance:base-select;background-image:none;padding-right:14px}
  .tour-form__field select::picker(select){appearance:base-select}
  /* Same chevron as the fallback, drawn via mask so it tracks currentColor. */
  .tour-form__field select::picker-icon{content:'';width:14px;height:14px;flex:none;align-self:center;background:var(--gray-500);mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;transition:transform var(--dur-med) var(--ease-out)}
  .tour-form__field select:open::picker-icon{transform:rotate(180deg)}
  .tour-form__field select::picker(select){
    background:#fff;border:1px solid var(--gray-200);border-radius:var(--radius-lg);
    box-shadow:var(--shadow-pop);padding:6px;margin-block-start:6px;
    opacity:0;transform:translateY(-4px);
    transition:opacity var(--dur-med) var(--ease-out),transform var(--dur-med) var(--ease-out),display var(--dur-med) allow-discrete,overlay var(--dur-med) allow-discrete;
  }
  .tour-form__field select:open::picker(select){opacity:1;transform:none}
  @starting-style{
    .tour-form__field select:open::picker(select){opacity:0;transform:translateY(-4px)}
  }
  .tour-form__field option{
    display:flex;align-items:center;gap:10px;
    font-size:15px;color:var(--ink-900);border-radius:var(--radius-sm);
    padding:9px 12px;transition:background var(--dur-fast) var(--ease-out);
  }
  .tour-form__field option:not(:disabled):where(:hover,:focus-visible){background:var(--gray-100)}
  .tour-form__field option:disabled{color:var(--gray-500)}
  .tour-form__field option:checked{font-weight:600}
  .tour-form__field option::checkmark{color:var(--rose-600);font-weight:700}
  @media (prefers-reduced-motion:reduce){
    .tour-form__field select::picker(select){transition-duration:.01s}
    .tour-form__field select::picker-icon{transition:none}
  }
}

/* Role: a radio group styled as pills; the fieldset reads like the other fields. */
.tour-role{border:none;margin:0;padding:0;min-width:0}
.tour-role legend{padding:0;margin-bottom:7px;font-size:13.5px;font-weight:600;color:var(--ink-900)}
.tour-role__opts{display:flex;flex-wrap:wrap;gap:8px}
.tour-chip{position:relative;cursor:pointer}
.tour-chip input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.tour-chip span{display:inline-flex;align-items:center;padding:10px 16px;border:1px solid var(--gray-300);border-radius:var(--radius-pill);font-size:14.5px;font-weight:500;color:var(--ink-900);background:#fff;transition:border-color var(--dur-fast) var(--ease-out),background var(--dur-fast) var(--ease-out),color var(--dur-fast) var(--ease-out)}
.tour-chip:hover span{border-color:var(--gray-500)}
.tour-chip input:checked + span{border-color:var(--rose-500);background:var(--rose-50);color:var(--rose-700);font-weight:600}
.tour-chip input:focus-visible + span{box-shadow:var(--focus-ring)}

.tour-renter{display:flex;flex-direction:column;gap:14px;background:var(--cream);border-radius:var(--radius-lg);padding:18px 20px}
.tour-renter[hidden]{display:none}
.tour-renter p{margin:0;font-size:15px;line-height:1.55;color:var(--ink-900)}

.tour-form__submit{margin-top:6px}
.tour-form__submit[hidden]{display:none}
.tour-form__submit[disabled]{cursor:not-allowed;opacity:.45;transform:none}
.tour-form__status{font-size:15px;margin:0;color:var(--rose-700)}
.tour-form__status a{font-weight:600}

/* ---------- confirmation ---------- */

.tour-done{display:flex;flex-direction:column;align-items:center;text-align:center;padding:16px 0 8px}
.tour-done[hidden],.tour-view[hidden]{display:none}
.tour-done__badge{width:80px;height:80px;border-radius:var(--radius-pill);background:var(--lime-400);display:flex;align-items:center;justify-content:center}
.tour-done__title{margin:24px 0 0;font-weight:800;font-size:30px;letter-spacing:-0.02em;line-height:1.05;text-transform:uppercase}
.tour-done__note{margin:12px 0 0;color:var(--gray-700);font-size:15px;line-height:1.55;max-width:320px}
.tour-done__note b{color:var(--ink-900);font-weight:600}
.tour-done__close{margin-top:24px}

/* ---------- motion (skipped entirely under reduced motion) ---------- */

@media (prefers-reduced-motion:no-preference){
  @keyframes tour-rise{from{opacity:0;transform:translateY(12px) scale(.96)}to{opacity:1;transform:none}}
  @keyframes tour-fade{from{opacity:0}to{opacity:1}}
  @keyframes tour-pulse-ring{0%{box-shadow:0 0 0 0 rgba(232,80,106,.4)}70%{box-shadow:0 0 0 16px rgba(232,80,106,0)}100%{box-shadow:0 0 0 0 rgba(232,80,106,0)}}
  @keyframes tour-arrive{from{opacity:0;transform:scale(.4)}to{opacity:1;transform:scale(1)}}
  @keyframes tour-pop-in{from{transform:scale(0)}to{transform:scale(1)}}
  @keyframes tour-draw-check{to{stroke-dashoffset:0}}

  /* Arrival: the button pops in after a beat, pings three times, and the
     teaser lands a half-beat later. */
  .tour-launcher{animation:tour-arrive .3s var(--ease-out) backwards}
  .tour-launcher--boot{animation:tour-arrive .5s var(--ease-out) 1s backwards,tour-pulse-ring 2.4s 1.6s 3}
  .tour-launcher--boot ~ .tour-teaser{animation-delay:1.5s}
  .tour-teaser{animation:tour-rise .4s var(--ease-out) backwards}
  .tour-modal[open]{animation:tour-rise .28s var(--ease-out)}
  .tour-modal[open]::backdrop{animation:tour-fade .28s var(--ease-out)}
  .tour-done__badge{animation:tour-pop-in .45s var(--ease-out) both}
  .tour-done__badge path{stroke-dasharray:26;stroke-dashoffset:26;animation:tour-draw-check .45s var(--ease-out) .35s forwards}
  .tour-done__title,.tour-done__note{animation:tour-rise .4s var(--ease-out) .2s both}
  .tour-done__close{animation:tour-rise .4s var(--ease-out) .4s both}
}
