/* ==========================================================================
   Login — passport layer (login.html only; forgot / reset keep auth.css alone)
   --------------------------------------------------------------------------
   The 2026-10-14 postcard landing carried into sign-in: the side panel is an
   open passport on the landing's green wash instead of the dark wave. Its
   left page holds the four open countries as perforated poster stamps (the
   same stamp as the landing's route cards); its right page follows who
   arrived (body[data-mode], set by js/login.js):
     signin    the case header they are going back to (real screen, sample data)
     register  the empty slot their agency's stamp will fill, then what happens next
     traveler  the agency that invited them and the portal on a phone
     agent     the agency that invited them and their role
   Below 960px the passport becomes one strip above the form.

   Also here: the sign in / create account switch, the "back to site" link
   and the language dropdown, all as on the landing.

   Load order: reset -> tokens -> ds -> auth.css -> this.
   ========================================================================== */

.auth-body { --wash: var(--green-050); --edge: #FFFFFF; }
.auth-body [hidden] { display: none !important; }
.auth-body ::selection { background: var(--selection-bg); color: var(--selection-text); }

.auth-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-col { padding: 0 var(--s-10) var(--s-5); }
.auth-topbar { justify-content: flex-start; min-height: 64px; }
.auth-ico { display: inline-flex; width: 16px; height: 16px; flex: none; }
.auth-ico svg { width: 16px; height: 16px; }
.auth-ico--back { rotate: 90deg; }

/* "Back to site": the agency landing, beside the brand. */
.auth-back {
  gap: var(--s-1);
  height: var(--h-md);
  min-height: 0;
  margin-right: auto;
  padding: 0 var(--s-2);
  border-radius: var(--r);
}
.auth-back:hover { background: var(--hover-quiet-bg); text-decoration: none; }
.auth-back[hidden] + .auth-lang,
.auth-topbar .auth-lang { margin-left: auto; }

/* Language: the shared .ds-langmenu (css/sayohatchi-ds.css). */
.auth-lang { position: relative; }

/* The form column. */
.auth-stack { display: grid; gap: var(--s-6); max-width: 440px; }
.auth-form { gap: var(--s-5); }
.auth-form .ds-field__control { height: var(--h-lg); font-size: 15px; }
.auth-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4); }

/* Sign in / create account: one segmented switch. */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--surface-muted); }
.auth-tabs button {
  display: grid; place-items: center; min-height: var(--h-md); padding: var(--s-1) var(--s-2);
  border: 0; border-radius: 6px; background: transparent;
  font: 500 var(--text-dense) / 1.2 var(--font-sans); color: var(--text-body);
  text-align: center; cursor: pointer; transition: var(--transition-control);
}
.auth-tabs button:hover { color: var(--text-strong); }
.auth-tabs button[aria-selected="true"] { background: var(--surface-card); color: var(--text-strong); box-shadow: 0 1px 2px rgb(15 46 38 / 0.08); }

/* Who invited them: a line with the agency mark (passport page and phone strip). */
/* Hidden until the invite preview names the agency (a failed preview never shows an empty line). */
.auth-from:has(.js-org-name:empty) { display: none; }
.auth-from { display: flex; align-items: center; gap: var(--s-3); }
.auth-from small { display: block; font: var(--type-meta); color: var(--text-muted); }
.auth-from b { font: 600 var(--text-base) / 1.3 var(--font-sans); color: var(--text-strong); }
.auth-mark { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 28%; background: var(--green-900); color: var(--lime-500); font: 600 15px / 1 var(--font-sans); }

/* ---------- the passport ---------- */
.auth-aside { display: grid; place-items: center; justify-content: center; padding: var(--s-12); background: var(--wash); border-left: 1px solid var(--border-default); color: var(--text-body); }
.auth-aside::after { content: none; }
.pp {
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 10px; border-radius: 18px; background: var(--green-900);
  box-shadow: 0 2px 4px rgb(15 46 38 / 0.06), 0 40px 80px -30px rgb(15 46 38 / 0.45);
  rotate: -3deg;
}
.pp-page { position: relative; display: grid; grid-template-rows: auto 1fr; gap: var(--s-3); width: clamp(220px, 19vw, 300px); aspect-ratio: 5 / 7; padding: var(--s-4); background: var(--edge); }
.pp-page--left { border-radius: 10px 2px 2px 10px; box-shadow: inset -14px 0 14px -14px rgb(15 46 38 / 0.28); }
.pp-page--right { border-radius: 2px 10px 10px 2px; box-shadow: inset 14px 0 14px -14px rgb(15 46 38 / 0.28); }
.pp-head { display: flex; justify-content: space-between; padding-bottom: var(--s-2); border-bottom: 1px solid var(--divider); font: 500 var(--text-xs) / 1 var(--font-sans); color: var(--text-muted); }
.pp-stamps, .pp-body { position: relative; }
.pp-body { display: grid; align-content: start; gap: var(--s-3); }

/* Perforated poster stamps, as on the landing's route cards. */
.pp-stamp { --hole: 4px; position: absolute; left: var(--x); top: var(--y); width: 44%; margin: 0; rotate: var(--r); filter: drop-shadow(0 1px 1px rgb(15 46 38 / 0.14)) drop-shadow(0 6px 10px rgb(15 46 38 / 0.12)); }
.pp-stamp > span {
  display: block;
  padding: calc(var(--hole) + 4px) calc(var(--hole) + 4px) calc(var(--hole) + 18px);
  background: var(--edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle var(--hole) at var(--hole) var(--hole), #0000 96%, #000) calc(-1 * var(--hole)) calc(-1 * var(--hole)) / calc(3.2 * var(--hole)) calc(3.2 * var(--hole)) round;
  mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle var(--hole) at var(--hole) var(--hole), #0000 96%, #000) calc(-1 * var(--hole)) calc(-1 * var(--hole)) / calc(3.2 * var(--hole)) calc(3.2 * var(--hole)) round;
}
.pp-stamp img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.pp-stamp figcaption { position: absolute; left: 0; right: 0; bottom: 8px; font: 600 10.5px / 1 var(--font-sans); color: var(--text-strong); text-align: center; }

/* A rubber-stamp mark: ink outline and words. */
.pp-ink {
  position: absolute; left: var(--x); top: var(--y); z-index: 2;
  display: grid; justify-items: center; gap: 2px; padding: 6px 12px;
  border: 2px solid var(--amber-700); border-radius: var(--r);
  font: 600 13px / 1 var(--font-sans); color: var(--amber-700);
  rotate: var(--r); opacity: 0.82; mix-blend-mode: multiply;
}
.pp-ink b { font: 500 10.5px / 1 var(--font-mono); }

.pp-photo { margin: 0; padding: 4px; border: 1px solid var(--border-default); border-radius: 6px; background: var(--edge); box-shadow: 0 1px 2px rgb(15 46 38 / 0.06); rotate: 1.5deg; }
.pp-photo img { display: block; width: 100%; height: auto; border-radius: 3px; }
.pp-caption { margin: 0; font: var(--type-meta); color: var(--text-body); }

.pp-slot { display: grid; place-items: center; align-content: center; gap: 2px; aspect-ratio: 4 / 3; padding: var(--s-4); border: 1.5px dashed var(--border-dashed); border-radius: var(--r-lg); text-align: center; transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease; }
.pp-slot span { font: 600 15px / 1.3 var(--font-sans); color: var(--text-muted); overflow-wrap: anywhere; }
.pp-slot small { font: var(--type-meta); color: var(--text-muted); }
.pp-slot.is-filled { border-style: solid; border-color: var(--green-700); background: var(--surface-selected); }
.pp-slot.is-filled span { color: var(--text-strong); }
.pp-slot--agent { aspect-ratio: 4 / 2.6; }
.pp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.pp-steps li { display: grid; grid-template-columns: 22px 1fr; gap: var(--s-2); align-items: start; font: 400 var(--text-sm) / 1.4 var(--font-sans); color: var(--text-body); }
.pp-steps .num { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-muted); font-size: 11px; color: var(--text-strong); }
.pp-body .auth-from { padding-bottom: var(--s-3); border-bottom: 1px solid var(--divider); }
.pp-phone { justify-self: center; width: 78%; margin: 0; padding: 6px 6px 0; border-radius: 20px 20px 0 0; background: var(--green-900); }
.pp-phone img { display: block; width: 100%; aspect-ratio: 390 / 470; object-fit: cover; object-position: top; border-radius: 15px 15px 0 0; }

/* Phones and narrow windows: the passport becomes one strip above the form. */
.auth-strip { display: none; }
@media (max-width: 960px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .auth-strip { display: block; }
  .auth-strip-stamps { display: flex; justify-content: center; padding: var(--s-5) 0 var(--s-2); border-radius: var(--r-lg); background: var(--wash); }
  .auth-strip-stamps img { width: 64px; aspect-ratio: 4 / 5; object-fit: cover; margin: 0 -6px; border: 4px solid var(--edge); border-radius: 3px; box-shadow: 0 6px 14px -6px rgb(15 46 38 / 0.35); }
  .auth-strip-stamps img:nth-child(1) { rotate: -7deg; }
  .auth-strip-stamps img:nth-child(2) { rotate: 3deg; translate: 0 -4px; }
  .auth-strip-stamps img:nth-child(3) { rotate: -2deg; }
  .auth-strip-stamps img:nth-child(4) { rotate: 7deg; translate: 0 2px; }
  .auth-strip .auth-from { padding: var(--s-3); border-radius: var(--r-lg); background: var(--wash); }
}
@media (max-width: 720px) {
  .auth-col { padding: 0 var(--s-4) var(--s-4); }
  .auth-form .ds-field__control { font-size: 16px; }
  .auth-row { grid-template-columns: minmax(0, 1fr); }
  .auth-back, .auth-tabs button { min-height: var(--h-lg); }
}
@media (prefers-reduced-motion: reduce) {
  .pp-slot { transition: none; }
}
