/* ==========================================================================
   Signup / login card, shared by the main brand-portal landing and the
   article landings (/brand-portal/l/<slug>/).

   The card is drawn in the article landings' press style (landing-press.css):
   white paper, a 2px black rule, a hard navy offset shadow, Anton for the
   tabs and the button, Jost for fields, Playfair italic for the divider. It
   carries its own palette (--ac-*) so it renders the same on the light
   articles and on the main landing in either theme. The pitch column beside
   it (.auth-intro) still follows the page it sits on.

   The three social buttons keep their brand fills on purpose: Google and Apple
   both require their own sign-in colours. Facebook's #1877f2 is darkened to
   #1461cf because white on the stock blue is 4.23:1 and fails AA.

   Class names and the DOM shape are unchanged: auth-card.js keys off
   .auth-tab / .auth-panel / .is-active / li.ok / [data-pw-toggle].
   ========================================================================== */

/* Self-hosted, same files as landing-press.css; the main landing loads only this sheet. */
@font-face { font-family: 'Anton'; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/anton-v27-latin.e57915c86b86.woff2") format('woff2'); }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/jost-v20-latin.41a72a3a0ae3.woff2") format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url("fonts/playfair-display-v40-latin-italic.f5051d38185e.woff2") format('woff2'); }

.auth-section {
  position: relative;
  padding: 0;
  text-align: left;
}

.auth-wrap {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 0.92fr;
  gap: clamp(2rem, 5vw, 5rem);
  /* The card runs ~1100px on the signup tab and the pitch ~400px; top-aligned
     that left two thirds of the left column empty. */
  align-items: center;
}

/* --- left column: the pitch --------------------------------------------- */

.auth-intro { text-align: left; padding-top: 0.4rem; }
/* Centred beside a card that is taller than a laptop screen, the pitch sat
   below the fold when "Créer mon app" jumped here. Sticky at the top keeps it
   beside the start of the form on arrival and with the reader as they fill
   the form in, without bringing back the empty column. */
@media (min-width: 901px) {
  .auth-intro { align-self: start; position: sticky; top: calc(var(--bar-h) + 5rem); }
}
/* .h2 already carries the landing's display face, size ramp and blood-red
   treatment. The old file re-declared all three plus a white text-shadow,
   which lit a halo around the letterforms. */
.auth-intro h2 { margin-bottom: 1.6rem; }

.auth-points {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}
.auth-points li {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--cream-soft);
  font-size: 0.98rem;
  line-height: 1.5;
  text-align: left;
}
/* The landing marks list items with a mono "+" (see .price li). Same here, so
   the two card stacks in the page read as one family. */
.auth-points .tick {
  flex: 0 0 auto;
  font: 700 1rem/1.5 var(--font-label);
  color: var(--accent);
}
.auth-point-text { flex: 1; }
.auth-point-text strong { color: var(--cream); font-weight: 600; }

/* --- the card ------------------------------------------------------------ */

.auth-card {
  --ac-ink: #05213D;
  --ac-ink-hover: #12355A;
  --ac-black: #0B0F14;
  --ac-text: #1E2733;
  --ac-muted: #5B6675;
  --ac-line: #C7CED8;
  --ac-paper: #FFFFFF;
  --ac-wash: #F1F5F9;
  --ac-oxblood: #701111;
  --ac-display: 'Anton', 'Lalezar', 'Impact', 'Arial Narrow', sans-serif;
  --ac-body: 'Jost', 'Noto Sans Arabic', 'Futura', 'Trebuchet MS', system-ui, sans-serif;
  --ac-serif: 'Playfair Display', 'Noto Sans Arabic', Georgia, serif;
  position: relative;
  color-scheme: light;
  background: var(--ac-paper);
  color: var(--ac-text);
  border: 2px solid var(--ac-black);
  border-radius: 0;
  box-shadow: 8px 8px 0 var(--ac-ink);
  font-family: var(--ac-body);
}
[dir="rtl"] .auth-card { box-shadow: -8px 8px 0 var(--ac-ink); }

/* Two flat halves over a black rule, the active one filled in navy. */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 2px solid var(--ac-black);
}
.auth-tab {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--ac-muted);
  padding: 0.9rem 0.75rem 0.8rem;
  min-height: 52px;
  font: 400 19px/1.05 var(--ac-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.auth-tab + .auth-tab { border-inline-start: 2px solid var(--ac-black); }
.auth-tab:hover { color: var(--ac-black); }
.auth-tab.is-active { background: var(--ac-ink); color: #fff; }

.auth-panel {
  display: none;
  padding: 1.4rem 1.25rem 1.2rem;
  text-align: left;
}
.auth-panel.is-active { display: block; animation: authFadeUp 0.45s var(--ease); }
@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-panel.is-active { animation: none; }
}

/* --- fields --------------------------------------------------------------- */

.auth-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.auth-row label {
  font: 600 14px/1.3 var(--ac-body);
  color: var(--ac-black);
}
.auth-row .input-wrap { position: relative; }
.auth-row input,
.auth-row .auth-select {
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 0.9rem;
  background: var(--ac-paper);
  border: 1.5px solid var(--ac-line);
  border-radius: 4px;
  color: var(--ac-text);
  font-family: var(--ac-body);
  /* 16px is the floor: below it iOS Safari zooms the page on every tap. */
  font-size: 16px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.auth-row input::placeholder { color: #7A8494; }
.auth-row .auth-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2305213D' 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 0.9rem center;
  background-size: 18px 18px;
}
.auth-row .auth-select:invalid { color: #7A8494; }
.auth-row .auth-select:focus,
.auth-row input:focus {
  outline: 0;
  border-color: var(--ac-ink);
  box-shadow: 0 0 0 3px rgba(5, 33, 61, 0.15);
}
/* Keyed on the wrapper, not on [type=password]: the toggle flips the input to
   type=text, which would drop the reserved room exactly when it is needed. */
.auth-row .input-wrap:has(.pw-toggle) input { padding-right: 5.4rem; }

.auth-row .pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--ac-ink);
  font: 600 14px/1 var(--ac-body);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0.75rem 0.6rem;
  min-height: 44px;
}
.auth-row .pw-toggle:hover { color: var(--ac-ink-hover); }

.auth-forgot {
  display: block;
  text-align: right;
  margin-top: 0.45rem;
  font-size: 14px;
  color: var(--ac-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-forgot:hover { color: var(--ac-ink); }

/* --- password checklist --------------------------------------------------- *
 * Mirrors the server validators (MinimumLength=12 + ComplexityValidator). The
 * server stays the judge; this is only the live hint.
 * -------------------------------------------------------------------------- */

.pw-checks {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.9rem;
}
.pw-checks li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ac-muted);
  transition: color 0.2s var(--ease);
}
.pw-checks li:first-child { grid-column: 1 / -1; }
.pw-checks .pc-ic {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  border-radius: 2px;
  border: 1.5px solid var(--ac-line);
  display: inline-grid;
  place-items: center;
  font: 800 10px/1 var(--ac-body);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.pw-checks li.ok { color: var(--ac-black); }
.pw-checks li.ok .pc-ic { border-color: var(--ac-ink); background: var(--ac-ink); color: #fff; }
.pw-checks li.ok .pc-ic::before { content: '\2713'; }

/* --- submit: the press call-to-action (.pr-btn) ---------------------------- */

.auth-submit {
  width: 100%;
  margin-top: 0.6rem;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1.4rem;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  background: var(--ac-ink);
  color: #fff;
  font: 400 21px/1.05 var(--ac-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}
.auth-submit:hover { transform: translateY(-2px); background: var(--ac-ink-hover); }
.auth-submit:active { transform: none; }
.auth-submit .arrow { font-family: var(--ac-body); transition: transform 0.25s var(--ease); }
.auth-submit:hover .arrow { transform: translateX(3px); }
.auth-submit:disabled,
.auth-submit:disabled:hover {
  cursor: not-allowed;
  transform: none;
  background: #E2E8F0;
  color: var(--ac-muted);
}

/* Field help and the "what is still missing" line under the button. Muted,
   not error-red: on a fresh form nothing is wrong yet, it is just unfinished. */
.auth-help {
  margin: 0.45rem 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ac-muted);
}
.auth-help a { color: var(--ac-ink); }
.auth-missing {
  margin: 0.6rem 0 0;
  min-height: 1.2em;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ac-muted);
}
.auth-missing:empty { display: none; }
.auth-turnstile { margin: 0.4rem 0 0.9rem; min-height: 65px; }

.auth-fineprint {
  text-align: center;
  margin: 0.9rem 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ac-muted);
}
.auth-fineprint a,
.auth-linklike {
  color: var(--ac-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.auth-fineprint a:hover, .auth-linklike:hover { color: var(--ac-ink-hover); }
.auth-linklike {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

/* --- social --------------------------------------------------------------- */

.auth-social-stack { display: grid; gap: 0.5rem; }
.auth-social-btn {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1.1rem;
  border-radius: 6px;
  border: 1.5px solid var(--ac-line);
  background: #fff;
  color: var(--ac-black);
  text-decoration: none;
  font: 600 15px/1.2 var(--ac-body);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), filter 0.2s var(--ease);
}
.auth-social-btn:hover { transform: translateY(-1px); border-color: var(--ac-black); }
.auth-social-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.auth-social-btn.is-apple { background: #000; color: #fff; border-color: #000; }
/* #1877f2 is only 4.23:1 against white text; this is the same hue at AA. */
.auth-social-btn.is-facebook { background: #1461cf; color: #fff; border-color: #1461cf; }
.auth-social-btn.is-apple:hover, .auth-social-btn.is-facebook:hover { filter: brightness(1.12); }

.auth-or {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.1rem 0;
  color: var(--ac-oxblood);
  font: italic 600 16px/1.2 var(--ac-serif);
}
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--ac-black); }

/* --- messages ------------------------------------------------------------- */

.auth-error {
  margin: 0 0 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  background: #FBF1F1;
  border-inline-start: 4px solid var(--ac-oxblood);
  color: var(--ac-oxblood);
  font-size: 14px;
  line-height: 1.45;
}
.auth-error::before {
  content: '!';
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ac-oxblood);
  color: #fff;
  display: grid;
  place-items: center;
  font: 700 12px/1 var(--ac-body);
}
.auth-notice {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  background: var(--ac-wash);
  border-inline-start: 4px solid var(--ac-ink);
  color: var(--ac-text);
  font-size: 14px;
  line-height: 1.45;
}

/* --- email verification step ---------------------------------------------- */

.auth-verify-intro {
  margin: 0.25rem 0 1.1rem;
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ac-text);
}
.auth-verify-intro strong { color: var(--ac-black); word-break: break-all; }
.auth-code-input {
  text-align: center;
  font-family: var(--ac-display) !important;
  font-size: 28px !important;
  letter-spacing: 0.45em;
  text-indent: 0.45em;
}

/* Arabic has no italic and no tracked capitals. */
[dir="rtl"] .auth-card :is(.auth-tab, .auth-submit) { letter-spacing: 0; text-transform: none; }
[dir="rtl"] .auth-or { font-style: normal; }

/* --- narrow --------------------------------------------------------------- */

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 2.2rem; }
  .auth-card { max-width: 520px; margin-inline: auto; width: 100%; }
  .auth-intro { max-width: 520px; margin-inline: auto; }
}

@media (max-width: 700px) {
  .auth-panel { padding: 1.2rem 0.9rem 0.9rem; }
  .auth-points li { font-size: 1.02rem; }
  /* Two columns of 12px hints wrap to three lines each on a phone. */
  .pw-checks { grid-template-columns: 1fr; }
  .pw-checks li:first-child { grid-column: auto; }
}

/* --- inside Instagram / Facebook ----------------------------------------- *
 * Google refuses sign-in in these embedded browsers, so the Google button is
 * not printed there; this block sends the reader to a real browser instead,
 * and the form below still works where they are.
 * ------------------------------------------------------------------------- */
.auth-inapp {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: var(--ac-wash);
  color: var(--ac-text);
  font-size: 14px;
  line-height: 1.5;
}
.auth-inapp p { margin: 0; }
.auth-inapp__title { font-weight: 600; color: var(--ac-black); }
.auth-inapp__how { margin-top: 0.35rem !important; }
.auth-inapp__open {
  margin-top: 0.7rem;
  display: flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0.6rem 1rem; border-radius: 8px;
  background: var(--ac-ink); color: #fff; text-decoration: none; font-weight: 600;
}
.auth-inapp__or { margin-top: 0.8rem !important; color: var(--ac-muted); }
