/**
 * FECABI — Auth / sign-in screens only
 * Brand + footer live in styles.css (.site-brand / .site-footer)
 */

/* Compact column so phone screen fits without scroll on standard mobile */
.auth {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.15rem 0 0.35rem;
  min-height: 0;
}

/* OTP step: slightly tighter brand→card so Verification box fits without scroll */
body.auth-step-otp .site-brand {
  margin-bottom: calc(1rem + 6px);
  gap: 0.28rem;
}

body.auth-step-otp .site-brand__logo,
body.auth-step-otp .site-brand__logo-fallback {
  width: 92px;
  height: 92px;
}

body.auth-step-otp .site-brand__title {
  font-size: clamp(0.95rem, 3.8vw, 1.1rem);
}

body.auth-step-otp .site-brand__org {
  font-size: 0.68rem;
}

/* Card shell — subtle green border + soft green glow */
.auth-card {
  position: relative;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-green);
  border-radius: var(--radius);
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(26, 122, 76, 0.1),
    0 0 28px rgba(26, 122, 76, 0.1);
  padding: 1.35rem 1.25rem 1.2rem;
  overflow: hidden;
}

/* Chooser / Google: keep the gold media stroke fully inside the green card frame */
.auth-card:has(.auth-flow.is-chooser),
.auth-card:has(.auth-flow.is-google) {
  padding-bottom: 0.72rem;
}

/* Thin tricolour line at top of card */
.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--green) 0%,
    var(--green) 33.33%,
    var(--red) 33.33%,
    var(--red) 66.66%,
    var(--gold) 66.66%,
    var(--gold) 100%
  );
}

/*
 * Hierarchy: Title → Subtitle → Field → CTA → FR|EN
 */
.auth-card__title {
  font-size: clamp(1.45rem, 5vw, 1.7rem);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  text-align: center;
  margin: 0.15rem 0 0.45rem;
  padding: 0 3.1rem;
}

.auth-retro {
  display: none;
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 3;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0.15rem 0.2rem;
  border: 0;
  background: none;
  color: var(--gold);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.auth-card--method .auth-retro {
  display: inline-flex;
}

.auth-retro:hover,
.auth-retro:focus-visible {
  color: #f3e0a8;
  outline: none;
}

.auth-card--email .auth-card__subtitle,
.auth-card--phone .auth-card__subtitle {
  display: none;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  margin: 0 0 0.95rem;
  border: 1.5px solid var(--border-green);
  border-radius: 12px;
  overflow: hidden;
  background: #0a100c;
  box-shadow:
    inset 0 0 0 1px rgba(26, 122, 76, 0.12),
    0 0 0 1px rgba(232, 200, 114, 0.08);
}

.auth-tab {
  min-height: 48px;
  padding: 0.55rem 0.4rem;
  border: 0;
  border-right: 1px solid rgba(26, 122, 76, 0.4);
  background: #0c120e;
  color: #d0d0d0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.auth-tab:last-child {
  border-right: 0;
}

.auth-tab.is-on {
  background: linear-gradient(180deg, #1f8f59 0%, #1a7a4c 100%);
  color: #fff;
  box-shadow: inset 0 -3px 0 #e8c872;
}

.auth-tab:focus-visible {
  outline: 2px solid #e8c872;
  outline-offset: -2px;
}

.auth-card__subtitle {
  font-size: 0.88rem;
  font-weight: 450;
  color: var(--text-muted);
  line-height: 1.45;
  text-align: center;
  margin: 0 0 1.15rem;
  width: 100%;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
  white-space: normal;
}

/* Two-step chooser → method (swipe left). Panes are pixel-pinned in JS. */
.auth-flow {
  overflow: hidden;
  width: 100%;
  position: relative;
}

.auth-flow__track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  width: max-content;
  max-width: none;
  transform: translate3d(0, 0, 0);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.auth-flow.is-instant,
.auth-flow.is-instant .auth-flow__track {
  transition: none;
}

.auth-flow__pane {
  box-sizing: border-box;
  flex: 0 0 var(--auth-pane-w, 100%);
  width: var(--auth-pane-w, 100%);
  min-width: var(--auth-pane-w, 100%);
  max-width: var(--auth-pane-w, 100%);
}

.auth-chips {
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
}

.auth-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 3.15rem;
  padding: 0.7rem 0.95rem 0.7rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-green);
  background: #0c120e;
  color: var(--text);
  font: inherit;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-align: left;
  box-shadow: inset 3px 0 0 var(--green);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.auth-chip__name {
  color: #f3f3f3;
  white-space: nowrap;
}

.auth-chip__chevron {
  color: var(--gold);
  font-size: 1.35rem;
  font-weight: 300;
  line-height: 1;
  margin-left: 0.5rem;
}

.auth-chip__meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.auth-chip__soon {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-muted, #c4b07a);
  opacity: 0.75;
}

.auth-chip:hover:not(:disabled):not(.auth-chip--soon),
.auth-chip:focus-visible:not(:disabled) {
  outline: none;
  border-color: var(--gold);
  background: #101810;
  box-shadow:
    inset 3px 0 0 var(--gold),
    0 0 0 1px rgba(232, 200, 114, 0.22);
}

.auth-chip:active:not(:disabled):not(.auth-chip--soon) {
  transform: translateX(2px);
}

.auth-chip--soon,
.auth-chip:disabled,
#btn-email-chip,
#btn-facebook {
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(0.35);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 3px 0 0 rgba(192, 57, 43, 0.45);
  background: #0a0a0a;
  pointer-events: none;
}

/* Invite pages are phone-only; Google stays on Connexion for Admin. */
body.page-invite .auth-chip[data-auth-method="google"] {
  display: none !important;
}

/* Login media — gold lining; pinned to the card so chooser + Google share one slot */
.auth-media {
  margin-top: 0.7rem;
  margin-bottom: 0;
  width: 100%;
}
.auth-card > .auth-media[hidden] {
  display: none;
}
/* iOS Safari only — Android keeps the current slot position */
html.is-ios-auth .auth-media {
  margin-top: 0.28rem;
}
.auth-media__stage {
  position: relative;
  width: 100%;
  min-height: 10.5rem;
  height: 38vw;
  max-height: 14.5rem;
  border-radius: 14px;
  border: 1.5px solid var(--gold, #e8c872);
  background: #070907;
  overflow: hidden;
  box-sizing: border-box;
}
.auth-media__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  display: block;
}
.auth-media__img,
.auth-media__video {
  opacity: 0;
  transition: opacity 0.45s ease;
}
.auth-media__img.is-on,
.auth-media__video.is-on {
  opacity: 1;
}
.auth-media__caption {
  position: absolute;
  right: 0.5rem;
  bottom: 0.38rem;
  z-index: 2;
  max-width: 74%;
  margin: 0;
  padding: 0.14rem 0.48rem 0.16rem;
  border-radius: 7px;
  background: rgba(6, 8, 6, 0.58);
  color: var(--gold, #e8c872);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}
.auth-media.is-empty .auth-media__caption,
.auth-media__caption[hidden],
.auth-media__caption:empty {
  display: none;
}
.auth-media__ph {
  position: absolute;
  inset: 0;
  display: none;
  padding: 0.85rem 1rem 0.8rem 1.05rem;
  color: #f4f4f4;
  text-align: left;
  box-sizing: border-box;
}
.auth-media.is-empty .auth-media__ph {
  display: block;
}
.auth-media__ph-title {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #fff;
}
.auth-media__ph ul {
  margin: 0;
  padding: 0 0 0 1.05rem;
}
.auth-media__ph li {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}
@media (max-height: 700px) {
  .auth-media__stage {
    min-height: 8.2rem;
    max-height: 11rem;
    height: 30vw;
  }
}
@media (prefers-reduced-motion: reduce) {
  .auth-media__img,
  .auth-media__video {
    transition: none;
  }
}

.auth-pane-back {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0 0 0.85rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
}

.auth-pane-back:hover,
.auth-pane-back:focus-visible {
  color: #f3e0a8;
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .auth-flow,
  .auth-flow__track,
  .auth-chip {
    transition: none;
  }
}

.auth-card__form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-card__form > .btn--primary {
  margin-top: 0.05rem;
}

/* Bottom lang switch removed on auth — FR|EN sit on brand row around logo */
.auth-card__form > .lang-switch-wrap,
.auth-success > .lang-switch-wrap {
  display: none !important;
}

/* Local-only Admin CTA (localhost / 127.0.0.1) */
.auth-local-dev {
  margin-top: 0.35rem;
  width: 100%;
  border: 1px dashed rgba(232, 200, 114, 0.45) !important;
  color: var(--gold-soft, #e8c872) !important;
  font-size: 0.85rem;
  font-weight: 600;
}
.auth-local-dev:hover {
  border-color: var(--gold) !important;
  color: #fff !important;
}
.auth-local-dev[hidden] {
  display: none !important;
}
.auth-local-picker {
  width: 100%;
  margin-top: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.auth-local-picker[hidden] {
  display: none !important;
}
.auth-local-picker__title {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e8c872;
  text-align: center;
}
.auth-local-picker__item {
  margin-top: 0;
  white-space: normal;
  line-height: 1.25;
  min-height: 44px;
}

/*
 * code_status_chip — OTP progress indicator (not a Validate button)
 * Empty: grey (same as empty digit boxes)
 * Each digit: +~16.666% green fill width → 6 digits = 100% green
 */
.code-status-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-neutral);
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  flex-shrink: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.code-status-chip__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(180deg, var(--green-hover) 0%, var(--green) 100%);
  transition: width 0.22s ease;
  border-radius: 0;
  z-index: 0;
}

/* Message inside chip (e.g. Invalid code on red) */
.code-status-chip__label {
  position: relative;
  z-index: 1;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
  color: #ffffff;
  pointer-events: none;
}

.code-status-chip__label[hidden] {
  display: none !important;
}

/* Soft gold edge when fully filled (matches primary CTA language) */
.code-status-chip.is-complete {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(232, 200, 114, 0.25);
}

.code-status-chip.is-complete .code-status-chip__fill {
  width: 100%;
}

/* Invalid code — full red + white label inside chip */
.code-status-chip.is-error {
  border-color: var(--error);
  box-shadow: 0 0 0 2px rgba(232, 90, 107, 0.22);
}

.code-status-chip.is-error .code-status-chip__fill {
  width: 100% !important;
  background: linear-gradient(180deg, #f06b7a 0%, var(--error) 100%);
}

.code-status-chip.is-error .code-status-chip__label {
  color: #ffffff;
}

.auth-success > .lang-switch-wrap {
  margin-top: 0.1rem;
}

/* Screens — only one visible at a time */
.auth-screen {
  width: 100%;
}

.auth-screen[hidden] {
  display: none !important;
}

/* OTP digit boxes — neutral default, gold focus */
.otp {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
}

.otp__digit {
  flex: 1;
  min-width: 0;
  max-width: 2.45rem;
  width: 2.45rem;
  height: 2.45rem;
  aspect-ratio: auto;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0;
  padding: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-neutral);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  caret-color: var(--gold);
}

.otp__digit:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--focus-ring-soft);
}

.otp__digit.otp__digit--error {
  border-color: var(--error);
  box-shadow: 0 0 0 2px rgba(232, 90, 107, 0.2);
}

/*
 * OTP meta: Resend (left) | Change number (right)
 * Countdown sits dead-center above the Resend CTA (counter only, e.g. "26s")
 */
.auth-meta {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: 18.5rem;
  margin: 0.15rem auto 0;
  padding: 0 0.15rem;
}

.auth-meta__left,
.auth-meta__right {
  display: flex;
  min-width: 0;
  flex: 1;
}

/* Stack: countdown → Resend, both centered as a column */
.auth-meta__left {
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.1rem;
}

.auth-meta__right {
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

/* Counter only — centered over the Resend label */
.auth-meta__countdown {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold-muted);
  line-height: 1.2;
  margin: 0;
  padding: 0;
  text-align: center;
  width: 100%;
  font-variant-numeric: tabular-nums;
  min-height: 1.1em;
}

.auth-meta__countdown[hidden] {
  display: none !important;
}

.auth-meta .btn--ghost {
  width: auto;
  min-height: 30px;
  padding: 0.2rem 0.35rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

.auth-meta__left .btn--ghost {
  justify-content: center;
  text-align: center;
}

.auth-meta__right .btn--ghost {
  justify-content: center;
  text-align: center;
}

.auth-meta .btn--ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/*
 * Verification (OTP) screen — breathing room without going tall again
 */
#screen-otp .auth-card {
  padding: 0.95rem 1.1rem 0.85rem;
}

#screen-otp .auth-card__title {
  /* 1. Title → “Enter the 6-digit…” */
  margin: 0 0 0.55rem;
  font-size: clamp(1.2rem, 4vw, 1.35rem);
}

#screen-otp .auth-phone-display {
  /* 2. Subtitle → 6 boxes */
  margin: 0 0 0.95rem;
  font-size: 0.78rem;
  line-height: 1.35;
}

#screen-otp .auth-card__form {
  /* 3. Boxes → green CTA (form gap after the field block) */
  gap: 0.95rem;
}

#screen-otp .auth-card__form > .code-status-chip {
  margin-top: 0.15rem;
}

#screen-otp .auth-card__form > .lang-switch-wrap {
  margin-top: -0.4rem;
}

#screen-otp .field {
  gap: 0.2rem;
}

/* Success screen — title uses .auth-card__title (same as Sign in / Verification) */
#screen-success .auth-card__title {
  margin-bottom: 0.85rem;
}

.auth-success {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.auth-success__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(26, 122, 76, 0.18);
  /* Bolder gold-yellow ring */
  border: 2.5px solid #e8c872;
  box-shadow: 0 0 0 1px rgba(232, 200, 114, 0.35);
  /* Thicker gold-yellow check */
  color: #e8c872;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
  -webkit-text-stroke: 0.6px #e8c872;
  text-shadow: 0 0 1px #e8c872;
  margin: 0.1rem 0 0.15rem;
}

.auth-success__welcome {
  font-size: 0.88rem;
  color: var(--gold-soft);
  font-weight: 500;
}

/* Single row under welcome */
.auth-success__message {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0 0 0.15rem;
  width: 100%;
  text-align: center;
  white-space: nowrap;
}

.auth-success .btn--primary {
  margin-top: 0.2rem;
  max-width: 240px;
}

/* Masked phone display on OTP screen */
.auth-phone-display {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: center;
  margin: 0 0 0.95rem;
}

.auth-phone-display strong {
  color: var(--gold-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Loading state on buttons */
.btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

@media (min-width: 480px) {
  .auth {
    padding-top: 0.5rem;
  }

  .auth-card {
    padding: 1.35rem 1.4rem 1.2rem;
  }

  .auth-card__title {
    margin-bottom: 0.5rem;
  }

  .auth-card__subtitle {
    margin-bottom: 1.15rem;
    white-space: nowrap;
  }

  .auth-phone-display {
    margin-bottom: 1.15rem;
  }

  .auth-card__form {
    gap: 1rem;
  }

  .otp {
    gap: 0.4rem;
    justify-content: center;
  }

  .otp__digit {
    max-width: 2.65rem;
    width: 2.65rem;
    height: 2.65rem;
  }

  #screen-otp .auth-card {
    padding: 1.05rem 1.3rem 0.95rem;
  }

  #screen-otp .auth-card__title {
    margin-bottom: 0.6rem;
  }

  #screen-otp .auth-card__form {
    gap: 1.05rem;
  }

  #screen-otp .auth-phone-display {
    margin-bottom: 1.05rem;
  }

  .auth-meta {
    max-width: 20rem;
  }
}

/*
 * Extra-compact: short viewports (e.g. ~667px height)
 * Keep first phone screen above the fold with footer.
 */
@media (max-height: 720px) {
  .site-brand__logo,
  .site-brand__logo-fallback {
    width: 88px;
    height: 88px;
  }

  .site-brand {
    gap: 0.28rem;
    /* Keep a clear gap even on short viewports */
    margin-bottom: calc(1.15rem + 6px);
  }

  .site-brand__title {
    font-size: 1rem;
    letter-spacing: 0.18em;
  }

  .site-brand__org {
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .auth-card {
    padding: 0.9rem 1.05rem 0.85rem;
  }

  .auth-card__subtitle {
    margin-bottom: 0.75rem;
    white-space: nowrap;
  }

  #screen-otp .auth-card {
    padding: 0.8rem 1rem 0.7rem;
  }

  #screen-otp .auth-card__title {
    margin-bottom: 0.45rem;
  }

  #screen-otp .auth-phone-display {
    margin-bottom: 0.75rem;
  }

  #screen-otp .auth-card__form {
    gap: 0.8rem;
  }

  #screen-otp .otp__digit {
    max-width: 2.2rem;
    width: 2.2rem;
    height: 2.2rem;
    font-size: 0.95rem;
  }

  #screen-otp .auth-meta .btn--ghost {
    min-height: 26px;
    font-size: 0.72rem;
  }

  .auth-meta {
    max-width: 17rem;
  }

  .site-footer {
    padding: 0.55rem 0.85rem 0.5rem;
  }
}

/* -- Google Sign-In (primary active) + phone/Facebook “soon” lock -- */
.auth-or {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  /* Clear vertical gap: Recevoir le code ⇄ Google */
  margin: 1.15rem 0 1.15rem;
}
.auth-or__line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}
.auth-or__text {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8a8a;
}
.btn--google,
.btn--facebook {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 1rem;
  border-radius: var(--radius, 10px);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}
.btn--google {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #fff;
  color: #1f1f1f;
  text-decoration: none;
  box-sizing: border-box;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(26, 122, 76, 0.25);
}
a.btn--google {
  display: inline-flex;
}
.btn--google:hover:not(:disabled) {
  background: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.12);
}
.btn--facebook {
  border: 1px solid #1877f2;
  background: #1877f2;
  color: #fff;
}
.btn--facebook:hover:not(:disabled) {
  background: #166fe5;
  border-color: #166fe5;
}
.btn--google:active:not(:disabled),
.btn--facebook:active:not(:disabled) {
  transform: scale(0.99);
}
.btn--google.is-loading {
  opacity: 0.7;
  cursor: wait;
}
/* Product lock: muted disabled (phone receive + Facebook) — not loading spinner style */
.btn--soon:disabled,
.btn--facebook.btn--soon:disabled,
.btn--primary.btn--soon:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.55);
  pointer-events: none;
  transform: none;
}
.btn--facebook.btn--soon:disabled {
  border-color: #8a9bb0;
  background: #8a9bb0;
  color: #f0f0f0;
}
.btn--primary.btn--soon:disabled {
  background: #6b7280;
  border-color: #6b7280;
  color: #e5e7eb;
  box-shadow: none;
}
.field__panel--disabled,
.field--soon .field__panel {
  opacity: 0.55;
  filter: grayscale(0.35);
  pointer-events: none;
  background: rgba(128, 128, 128, 0.12);
}
.field--soon .field__input:disabled,
.field--soon .field__input[readonly] {
  cursor: not-allowed;
  color: #9ca3af;
  opacity: 1;
}
.auth-soon-label {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: #9ca3af;
  text-align: left;
}
#otp-demo-hint {
  margin: 0.35rem 0 0.15rem;
  color: #e8c872;
  text-align: center;
}
.auth-social-soon .auth-soon-label {
  text-align: center;
  margin-top: 0.4rem;
}
.auth-soon-stack {
  width: 100%;
  margin-top: 1.05rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.5rem;
}
.auth-soon-heading {
  grid-column: 1 / -1;
  margin: 0.15rem 0 0.1rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a8a8a;
  text-align: center;
}
.auth-soon-stack .auth-social-soon {
  margin-top: 0;
}
.auth-soon-stack .auth-soon-label {
  display: none;
}
.btn--tiktok,
.btn--whatsapp,
.btn--sms {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 40px;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius, 10px);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 650;
}
.auth-soon-stack .btn--facebook {
  min-height: 40px;
  font-size: 0.75rem;
  padding: 0.45rem 0.55rem;
}
.btn--tiktok {
  border: 1px solid #3a3a3a;
  background: #111;
  color: #fff;
}
.btn--whatsapp {
  border: 1px solid #1ea952;
  background: #25d366;
  color: #073b1a;
}
.btn--sms {
  border: 1px solid #6b7280;
  background: #4b5563;
  color: #f3f4f6;
}
.btn--tiktok.btn--soon:disabled,
.btn--whatsapp.btn--soon:disabled,
.btn--sms.btn--soon:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.55);
  pointer-events: none;
}
.auth-soon-btn__icon {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
#email-form {
  width: 100%;
  gap: 0.7rem;
}
#email-form .field + .field {
  margin-top: 0;
}
#email-form .field__panel {
  min-height: 48px;
}
#email-form .field__input {
  font-size: 1rem;
}
#btn-email {
  margin-top: 0.35rem;
  width: 100%;
  min-height: 50px;
  font-size: 1rem;
  letter-spacing: 0.01em;
}
#email-form.is-busy .field__input {
  pointer-events: none;
  opacity: 0.72;
}
.auth-login-progress {
  margin: 0.45rem 0 0;
  width: 100%;
}
.auth-login-progress[hidden] {
  display: none !important;
}
.auth-login-progress__track {
  display: block;
  position: relative;
  height: 4px;
  border-radius: 99px;
  background: rgba(26, 122, 76, 0.28);
  overflow: hidden;
}
.auth-login-progress__bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 38%;
  border-radius: 99px;
  background: var(--gold, #e8c872);
  animation: auth-login-indeterminate 1.15s ease-in-out infinite;
}
.auth-login-progress__label {
  margin: 0.4rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--gold, #e8c872);
}
@keyframes auth-login-indeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
#password-confirm-wrap[hidden] {
  display: none !important;
}
.auth-password-toggle {
  width: 100%;
  min-height: 36px;
  margin-top: -0.15rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold-muted);
  text-decoration: none;
}
#btn-forgot-password {
  margin: 0.15rem 0 0.35rem;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
#btn-forgot-password[hidden] {
  display: none !important;
}
#btn-forgot-password:disabled {
  opacity: 0.65;
  cursor: wait;
}
.auth-password-toggle:hover {
  color: var(--gold);
}
#email-link-status {
  margin-top: 0.55rem;
  color: #6dcf9a;
  text-align: center;
  font-weight: 650;
}
.page-invite #invite-auth-root {
  width: 100%;
  margin: 0 auto 1rem;
}
.page-invite #invite-auth-root[hidden],
.page-invite #invite-welcome-root[hidden] {
  display: none !important;
}
.auth-google__icon,
.auth-facebook__icon {
  display: inline-flex;
  flex-shrink: 0;
}
.auth-google__label,
.auth-facebook__label {
  line-height: 1.2;
}
#google-error,
#facebook-error,
#social-error,
#email-error,
#email-form-error {
  margin-top: 0.45rem;
  text-align: center;
  min-height: 1.1em;
}
.auth-card__form > .btn--google,
.auth-card > .btn--google {
  margin-top: 0;
  width: 100%;
}
.auth-card__form > .btn--facebook,
.auth-card__form > .auth-social-soon {
  margin-top: 1.15rem;
}
.auth-entry-lock .auth-card__form > .btn--primary {
  margin-top: 0.15rem;
}

/* Invite-only Google banner */
.auth-invite-hint {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: rgba(245, 197, 66, 0.12);
  border: 1px solid rgba(245, 197, 66, 0.35);
  color: #e8c872;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

/* Pre-login consent gate — fill the viewport; only inner panes scroll.
   100vh fallback: some Android WebViews (TECNO / HiOS) ignore dvh. */
html.auth-step-gate,
body.auth-step-gate {
  height: 100%;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  max-height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
body.auth-step-gate .page {
  height: 100%;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  max-height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.auth-step-gate .auth {
  flex: 1 1 0%;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  padding-bottom: 0;
}
body.auth-step-gate #screen-gate {
  flex: 1 1 0%;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Invite shell: extra .em-wrap between .page and .auth. */
body.auth-step-gate.page-invite .em-wrap--kyc {
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
}
body.auth-step-gate.page-invite #invite-auth-root {
  flex: 1 1 0%;
  min-height: 0;
  width: 100%;
  margin-bottom: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.auth-step-gate .site-footer,
body.auth-step-gate [data-site-footer] {
  display: none !important;
}
.auth-card--gate {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  max-height: 100%;
  width: 100%;
  overflow: hidden;
  padding: 0.85rem 1.05rem 0.85rem;
  padding-bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
}
.auth-card--gate > .auth-card__title,
.auth-card--gate > .auth-gate__portrait,
.auth-card--gate > .auth-gate__accept,
.auth-card--gate > #btn-gate-continue {
  flex: 0 0 auto;
}
.auth-gate__letter {
  flex: 1 1 0%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding-right: 0.1rem;
}
.auth-gate__intro {
  display: none !important;
}
.auth-card--gate.is-legal .auth-gate__letter {
  display: none !important;
}
.auth-card--gate > .auth-card__title {
  padding: 0 0.2rem;
  margin: 0.1rem 0 0.4rem;
  white-space: nowrap;
  font-size: clamp(0.95rem, 4.7vw, 1.32rem);
  letter-spacing: 0.045em;
  line-height: 1.1;
}
body.auth-step-gate .site-brand__title,
body.auth-step-gate #auth-kicker {
  display: none !important;
}
body.auth-step-gate .em-home-screen-title-row {
  display: none !important;
  margin: 0 !important;
  height: 0 !important;
}
body.auth-step-gate .site-brand {
  margin-bottom: 0.55rem;
  gap: 0.22rem;
}

.auth-gate__portrait {
  margin: 0.2rem 0 0.55rem;
  display: flex;
  justify-content: center;
}
.auth-gate__photo-row {
  position: relative;
  display: block;
  width: 5.7rem;
  flex: 0 0 auto;
}
.auth-gate__frame {
  width: 5.7rem;
  height: 7.15rem;
  margin: 0;
  border: 2px solid #e8c872;
  border-radius: 0.35rem;
  background: rgba(232, 200, 114, 0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.auth-gate__sign {
  position: absolute;
  left: 100%;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  margin: 0 0 0 0.38rem;
  padding: 0;
  color: #e8c872;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.22;
  text-align: left;
  white-space: nowrap;
}
.auth-gate__sign-name,
.auth-gate__sign-role,
.auth-gate__sign-org {
  display: block;
  white-space: nowrap;
}
.auth-gate__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.auth-gate__ph {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(232, 200, 114, 0.16) 0%, rgba(26, 122, 76, 0.12) 100%);
}
.auth-gate__ph[hidden] {
  display: none !important;
}
.auth-gate__caption {
  display: none;
}
.auth-gate__word {
  margin: 0 0 0.55rem;
  color: #f2f2f2;
  font-size: 0.7rem;
  line-height: 1.38;
}
.auth-gate__priorities-title {
  margin: 0 0 0.4rem;
  color: #e8c872;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.auth-gate__priorities {
  margin: 0 0 0.35rem;
  padding: 0 0 0 1.05rem;
  color: #f2f2f2;
  font-size: 0.68rem;
  line-height: 1.32;
}
.auth-gate__priorities li {
  margin: 0 0 0.32rem;
}
.auth-gate__legal {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.68rem;
  line-height: 1.4;
}
.auth-gate__legal a {
  color: #e8c872;
  text-decoration: underline;
}
.auth-gate__accept {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  flex: 0 0 auto;
  margin: 0.65rem 0 0;
  padding-bottom: max(0.35rem, env(safe-area-inset-bottom, 0px));
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.4;
  cursor: pointer;
}
.auth-gate__accept[hidden] {
  display: none !important;
}
.auth-gate__accept.is-locked {
  opacity: 0.45;
  cursor: not-allowed;
}
.auth-gate__accept input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  margin: 0.08rem 0 0;
  border: 2px solid #fff;
  border-radius: 0.18rem;
  background: transparent;
  cursor: pointer;
}
.auth-gate__accept input:checked {
  background: #1a7a4c;
  border-color: #1a7a4c;
  box-shadow: inset 0 0 0 0.22rem #fff;
}
.auth-gate__accept input:disabled {
  cursor: not-allowed;
}
.auth-gate__check {
  display: none !important;
}
#btn-gate-continue {
  flex: 0 0 auto;
  margin-top: 0.65rem;
  width: 100%;
}
#btn-gate-continue:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.auth-card--gate.is-legal #btn-gate-continue {
  display: none !important;
}
.auth-card--gate.is-legal #gate-word,
.auth-card--gate.is-legal #gate-priorities-title,
.auth-card--gate.is-legal .auth-gate__priorities,
.auth-card--gate.is-legal .auth-gate__intro {
  display: none !important;
}
.auth-gate__intro {
  display: none !important;
}
.auth-card--gate.is-legal {
  min-height: 0;
  overflow: hidden;
}
.auth-card--gate.is-legal .auth-gate__accept {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  background: var(--bg-card);
}
/* flex-basis 0% + min-height keeps a scrollport on Android and iOS WKWebView.
   overflow-y:scroll (not auto) creates the pane before content is measured. */
.auth-gate-legal {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 8rem;
  overflow: hidden;
  padding: 0;
  background: transparent;
}
.auth-gate-legal[hidden] {
  display: none !important;
}
.auth-gate-legal__title {
  margin: 0 0 0.45rem;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  flex: 0 0 auto;
}
.auth-gate-legal__scroll {
  flex: 1 1 0%;
  min-height: 8rem;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  overflow-anchor: none;
  padding: 0 0.15rem 1.1rem;
  color: #f2f2f2;
  font-size: 0.74rem;
  line-height: 1.45;
}
.auth-gate-legal__scroll h1,
.auth-gate-legal__scroll h2 {
  color: #e8c872;
  font-size: 0.8rem;
  margin: 0.7rem 0 0.3rem;
}
.auth-gate-legal__doc + .auth-gate-legal__doc {
  margin-top: 1.1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(232, 200, 114, 0.28);
}
.auth-gate-legal__doc > h2:first-child {
  margin-top: 0;
}
.auth-gate-legal__scroll p,
.auth-gate-legal__scroll li {
  margin: 0 0 0.4rem;
}
.auth-gate-legal__scroll ul {
  margin: 0 0 0.45rem;
  padding-left: 1.05rem;
}
.auth-gate-legal__scroll a {
  color: #e8c872;
}
.auth-gate-legal__mark {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.45rem 0 0;
  color: #fff;
  font-size: 0.74rem;
  cursor: pointer;
}
.auth-gate-legal__mark input {
  margin-top: 0.12rem;
  accent-color: #1a7a4c;
}
.auth-gate__legal a.is-read::after {
  content: " ✓";
  color: #1a7a4c;
  font-weight: 700;
}

/* Sign-in bind wait — covers the card, does not restyle chips */
.auth-bind-progress {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.4rem 1.2rem;
  background: rgba(10, 18, 14, 0.92);
  text-align: center;
}
.auth-bind-progress[hidden] {
  display: none !important;
}
.auth-bind-progress__title {
  margin: 0 0 0.35rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.auth-bind-progress__sub {
  margin: 0 0 1rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
}
.auth-bind-progress__track {
  width: 100%;
  max-width: 16rem;
  height: 0.42rem;
  border-radius: 99px;
  background: rgba(232, 200, 114, 0.18);
  overflow: hidden;
}
.auth-bind-progress__bar {
  height: 100%;
  width: 12%;
  border-radius: 99px;
  background: linear-gradient(90deg, #1a7a4c, #e8c872);
  transition: width 0.45s ease;
}
.auth-bind-progress__step {
  margin: 0.7rem 0 0;
  color: #e8c872;
  font-size: 0.76rem;
  font-weight: 600;
}
