/* ═══════════════════════════════════════════════════════════
   AUTH CONNECT — Lot 2A (2026-09-14)
   Page de connexion / inscription client, entierement pilotee par le theme
   du restaurant (couleur_principale / couleur_secondaire / background_color,
   memes valeurs et memes seuils de contraste que /menu — voir account_auth.php).
   Classes prefixees .ecx- pour ne jamais entrer en collision avec le reste
   du site (public.css, order-premium.css, etc.).
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

.ecx-body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--restaurant-bg);
  color: var(--theme-text-on-bg);
}

/* ── Surfaces neutres derivees du theme (jamais une teinte de marque figee) ──
   Le sens du melange (vers le blanc ou vers le noir) depend de la luminance
   REELLE de background_color, calculee cote serveur (voir $authTone) — pas
   d'hypothese arbitraire sur la couleur choisie par le restaurant. */
.ecx-body[data-tone="light"] {
  --ecx-surface: color-mix(in srgb, var(--restaurant-bg) 100%, black 4%);
  --ecx-surface-2: color-mix(in srgb, var(--restaurant-bg) 100%, black 7%);
  --ecx-input-bg: color-mix(in srgb, var(--restaurant-bg) 100%, black 3%);
  --ecx-input-bg-focus: color-mix(in srgb, var(--restaurant-bg) 100%, black 6%);
  --ecx-shadow: 0 24px 60px color-mix(in srgb, var(--restaurant-bg) 60%, black 40%);
}
.ecx-body[data-tone="dark"] {
  --ecx-surface: color-mix(in srgb, var(--restaurant-bg) 100%, white 6%);
  --ecx-surface-2: color-mix(in srgb, var(--restaurant-bg) 100%, white 10%);
  --ecx-input-bg: color-mix(in srgb, var(--restaurant-bg) 100%, white 8%);
  --ecx-input-bg-focus: color-mix(in srgb, var(--restaurant-bg) 100%, white 13%);
  --ecx-shadow: 0 24px 60px rgba(0,0,0,.55);
}

.ecx-body[data-hero-tone="light"] {
  --ecx-hero-overlay-a: color-mix(in srgb, var(--secondary-color) 88%, white 12%);
  --ecx-hero-overlay-b: var(--secondary-color);
}
.ecx-body[data-hero-tone="dark"] {
  --ecx-hero-overlay-a: color-mix(in srgb, var(--secondary-color) 82%, black 18%);
  --ecx-hero-overlay-b: var(--secondary-color);
}

/* ════════════════════════════════════════════
   DESKTOP — Split screen
════════════════════════════════════════════ */
.ecx-split {
  display: grid;
  grid-template-columns: 1fr 480px;
  min-height: 100vh;
}

/* ── Panneau gauche — photo + identite restaurant ── */
.ecx-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 56px;
  background-color: var(--secondary-color);
  background-image: var(--ecx-panel-photo);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.ecx-panel__overlay {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(
    168deg,
    color-mix(in srgb, var(--ecx-hero-overlay-a) 88%, transparent) 0%,
    color-mix(in srgb, var(--ecx-hero-overlay-a) 38%, transparent) 38%,
    color-mix(in srgb, var(--ecx-hero-overlay-b) 55%, transparent) 68%,
    color-mix(in srgb, var(--ecx-hero-overlay-b) 95%, transparent) 100%
  );
}

.ecx-panel__top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
}

.ecx-panel__brand { display: flex; align-items: center; gap: 14px; }

.ecx-panel__logo {
  width: 48px; height: 48px; border-radius: 12px;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--hero-text) 20%, transparent);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
  display: block; flex-shrink: 0;
  background: #fff;
}
.ecx-panel__logo-text {
  width: 48px; height: 48px; border-radius: 12px;
  background: color-mix(in srgb, var(--hero-text) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--hero-text) 20%, transparent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px; font-weight: 600; color: var(--hero-text);
  flex-shrink: 0;
}

.ecx-panel__name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 20px; font-weight: 500;
  color: var(--hero-text); letter-spacing: -.01em;
  line-height: 1;
}

.ecx-panel__back {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600;
  color: var(--hero-subtext); text-decoration: none;
  letter-spacing: .04em; text-transform: uppercase;
  transition: color .18s ease;
}
.ecx-panel__back:hover { color: var(--hero-text); }
.ecx-panel__back:focus-visible {
  outline: 2px solid var(--primary-color-readable);
  outline-offset: 3px;
  border-radius: 4px;
}

.ecx-panel__center { position: relative; z-index: 2; }

.ecx-panel__eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: .25em;
  text-transform: uppercase; color: var(--hero-subtext);
  margin-bottom: 22px;
  display: flex; align-items: center; gap: 12px;
}
.ecx-panel__eyebrow::before {
  content: ''; display: block;
  width: 28px; height: 1px; background: var(--hero-subtext);
}

.ecx-panel__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(3rem, 5vw, 5.4rem);
  font-weight: 500; font-style: normal;
  letter-spacing: -.02em; line-height: .96;
  color: var(--hero-text); margin: 0 0 22px;
}
.ecx-panel__title em {
  font-style: italic; font-weight: 400;
  color: var(--hero-subtext); display: block;
}

.ecx-panel__tagline {
  font-size: .95rem; color: var(--hero-subtext);
  line-height: 1.7; font-weight: 400; max-width: 340px;
  letter-spacing: .01em;
}

.ecx-panel__footer { position: relative; z-index: 2; min-height: 1px; }

/* ── Panneau droit — formulaire ── */
.ecx-divider {
  position: absolute; top: 0; bottom: 0; left: 0; width: 1px;
  background: linear-gradient(to bottom, transparent, var(--theme-border-on-bg) 20%, var(--theme-border-on-bg) 80%, transparent);
  pointer-events: none;
}

.ecx-form-panel {
  position: relative;
  background: var(--restaurant-bg);
  display: flex; flex-direction: column;
}

.ecx-form-panel__inner {
  flex: 1; padding: 56px 48px;
  display: flex; flex-direction: column; justify-content: center;
  overflow-y: auto;
}

/* ── Tabs desktop ── */
.ecx-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--theme-border-on-bg);
  margin-bottom: 40px;
}
.ecx-tab {
  flex: 1; text-align: center;
  padding-bottom: 14px;
  font-size: .72rem; font-weight: 700;
  color: var(--theme-text-muted-on-bg); text-decoration: none;
  border-bottom: 1.5px solid transparent;
  margin-bottom: -1px;
  letter-spacing: .14em; text-transform: uppercase;
  transition: color .18s ease, border-color .18s ease;
}
.ecx-tab:hover:not(.is-active) { color: var(--theme-text-on-bg); }
.ecx-tab.is-active {
  color: var(--theme-text-on-bg);
  border-bottom-color: var(--primary-color-readable);
}
.ecx-tab:focus-visible {
  outline: 2px solid var(--primary-color-readable);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Heading desktop ── */
.ecx-heading { margin-bottom: 32px; }
.ecx-heading__kicker {
  font-size: .68rem; font-weight: 700; letter-spacing: .22em;
  text-transform: uppercase; color: var(--primary-color-readable);
  margin-bottom: 12px; display: block;
}
.ecx-heading__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.9rem, 3.5vw, 2.7rem);
  font-weight: 500; font-style: normal;
  letter-spacing: -.01em; line-height: 1.05;
  color: var(--theme-text-on-bg); margin: 0;
}

/* ── Fields ── */
.ecx-fields { display: flex; flex-direction: column; gap: 16px; }
.ecx-fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ecx-field { display: flex; flex-direction: column; gap: 8px; }

.ecx-field label {
  font-size: .66rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--theme-text-muted-on-bg);
}
.ecx-field label .opt {
  font-weight: 400; text-transform: none;
  letter-spacing: 0; color: var(--theme-text-muted-on-bg);
  font-size: .6rem; margin-left: 3px; opacity: .8;
}

.ecx-input-wrap {
  position: relative; display: flex; align-items: center;
  background: var(--ecx-input-bg);
  border: 1px solid var(--theme-border-on-bg);
  border-radius: 10px;
  transition: border-color .18s ease, background .18s ease;
  overflow: hidden;
}
.ecx-input-wrap:focus-within {
  border-color: var(--primary-color-readable);
  background: var(--ecx-input-bg-focus);
}
.ecx-input-icon {
  position: absolute; left: 14px;
  color: var(--theme-text-muted-on-bg); pointer-events: none; display: flex;
  opacity: .75;
  transition: color .18s ease;
}
.ecx-input-wrap:focus-within .ecx-input-icon { color: var(--primary-color-readable); opacity: 1; }

.ecx-input-wrap input {
  width: 100%; height: 50px;
  padding: 0 14px 0 42px;
  background: transparent;
  border: none;
  font-size: .95rem; color: var(--theme-text-on-bg); font-weight: 400;
  font-family: inherit; outline: none; border-radius: 0;
  -webkit-appearance: none;
  letter-spacing: .01em;
}
.ecx-input-wrap input::placeholder { color: var(--theme-text-muted-on-bg); font-weight: 400; opacity: .75; }
.ecx-input-wrap input:focus-visible { outline: none; }
.ecx-input-wrap:has(input:focus-visible) {
  outline: 2px solid var(--primary-color-readable);
  outline-offset: 2px;
}

.ecx-legal {
  font-size: .68rem; color: var(--theme-text-muted-on-bg);
  line-height: 1.65; margin: 0; letter-spacing: .01em;
}
.ecx-legal a { color: var(--primary-color-readable); text-decoration: none; opacity: .9; }
.ecx-legal a:hover { opacity: 1; text-decoration: underline; }

/* ── CTA ──
   background/box-shadow/min-height passes !important, selecteur double .ecx-cta.ecx-cta :
   public.css (fichier partage, hors perimetre Lot 2A) contient une regle globale non scopee
   "button[type="submit"]{...!important}" (bleu fixe #101624→#0b57d0, destinee aux pages
   commande/reservation) dont la specificite (element+attribut) depasse une simple classe -
   necessite a la fois !important ET une specificite doublee pour la neutraliser ici sans
   modifier ce fichier partage. */
.ecx-cta.ecx-cta {
  width: 100%; height: 52px; min-height: 52px !important;
  background: var(--primary-color) !important;
  box-shadow: none !important;
  color: var(--theme-text-on-primary);
  font-size: .74rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase;
  border: none; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 0 24px; border-radius: 10px;
  transition: filter .2s ease, transform .15s ease, opacity .2s ease;
  position: relative;
}
.ecx-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ecx-cta:active { transform: translateY(0); }
.ecx-cta:focus-visible {
  outline: 2px solid var(--theme-text-on-bg);
  outline-offset: 3px;
}
.ecx-cta__text { position: relative; z-index: 1; }
.ecx-cta__spinner {
  display: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--theme-text-on-primary) 35%, transparent);
  border-top-color: var(--theme-text-on-primary);
  animation: ecx-spin .7s linear infinite;
}
.ecx-cta.is-loading { cursor: progress; opacity: .92; pointer-events: none; }
.ecx-cta.is-loading .ecx-cta__spinner { display: inline-block; }
@keyframes ecx-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ecx-cta__spinner { animation-duration: 1.4s; }
}

.ecx-switch {
  text-align: center; font-size: .72rem;
  color: var(--theme-text-muted-on-bg); font-weight: 400;
  margin: 0; letter-spacing: .01em;
}
.ecx-switch a { color: var(--theme-text-on-bg); font-weight: 600; text-decoration: none; }
.ecx-switch a:hover { text-decoration: underline; }
.ecx-switch a:focus-visible, .ecx-legal a:focus-visible {
  outline: 2px solid var(--primary-color-readable);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── Flash ── */
.ecx-flash {
  padding: 12px 15px; border-radius: 8px;
  font-size: .82rem; font-weight: 500; line-height: 1.5; margin-bottom: 18px;
  border: 1px solid transparent;
}
.ecx-flash--success {
  background: color-mix(in srgb, var(--primary-color) 14%, var(--ecx-surface));
  border-color: color-mix(in srgb, var(--primary-color) 35%, transparent);
  color: var(--theme-text-on-bg);
}
.ecx-flash--error {
  background: color-mix(in srgb, #dc3c28 14%, var(--ecx-surface));
  border-color: color-mix(in srgb, #dc3c28 35%, transparent);
  color: var(--theme-text-on-bg);
}


/* ════════════════════════════════════════════════════════
   MOBILE
════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  .ecx-split {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .ecx-panel {
    min-height: 0;
    max-height: none;
    padding: 84px 0 0;
    flex-direction: column;
    justify-content: flex-end;
    background-position: center 30%;
    flex-shrink: 0;
  }

  .ecx-panel__top {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 18px 20px;
    z-index: 5;
  }
  .ecx-panel__logo,
  .ecx-panel__logo-text {
    width: 38px; height: 38px;
    border-radius: 10px;
  }
  .ecx-panel__logo-text { font-size: 17px; }
  .ecx-panel__name { font-size: 18px; }
  .ecx-panel__back { font-size: 11px; }

  .ecx-panel__center {
    padding: 0 24px 48px;
    text-align: center;
    position: relative; z-index: 3;
  }
  .ecx-panel__eyebrow {
    font-size: 9px; letter-spacing: .25em;
    justify-content: center; margin-bottom: 10px;
  }
  .ecx-panel__eyebrow::before { display: none; }
  .ecx-panel__title {
    font-size: 2.1rem;
    text-align: center; margin-bottom: 6px;
    line-height: .96;
  }
  .ecx-panel__tagline {
    font-size: .82rem; text-align: center;
    max-width: 100%;
  }
  .ecx-panel__footer { display: none; }

  .ecx-form-panel {
    flex: 1;
    background: var(--restaurant-bg);
    border-radius: 22px 22px 0 0;
    margin-top: -24px;
    position: relative; z-index: 4;
    box-shadow: var(--ecx-shadow);
    display: flex; flex-direction: column;
  }

  .ecx-form-panel::before {
    content: '';
    display: block;
    width: 34px; height: 3px;
    border-radius: 2px;
    background: var(--theme-border-on-bg);
    margin: 12px auto 0;
    flex-shrink: 0;
  }

  .ecx-divider { display: none; }

  .ecx-form-panel__inner {
    padding: 20px 22px 48px;
    justify-content: flex-start;
    overflow-y: auto;
    flex: 1;
  }

  .ecx-tabs { margin-bottom: 26px; }
  .ecx-tab { padding: 0 0 13px; font-size: .68rem; }

  .ecx-heading { margin-bottom: 22px; }
  .ecx-heading__title { font-size: 1.7rem; line-height: 1.08; }

  .ecx-fields { gap: 12px; }
  .ecx-fields-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ecx-field { gap: 6px; }

  .ecx-input-wrap input { height: 52px; padding: 0 14px 0 42px; font-size: .96rem; }
  .ecx-input-icon { left: 14px; }

  .ecx-legal { font-size: .65rem; margin: 8px 0 16px; }

  .ecx-cta { height: 52px; margin-bottom: 18px; }

  .ecx-switch { font-size: .74rem; }
}

/* 400px (et non 390px) : une largeur CSS de 390px exactement peut, selon l'arrondi du
   pixel-ratio de l'appareil, evaluer tout juste au-dessus du seuil - meme marge de securite
   que le correctif mobile deja en production sur order-premium.css (Lot 1B). */
@media (max-width: 400px) {
  .ecx-panel { min-height: 42vh; }
  .ecx-panel__title { font-size: 2.25rem; }
  .ecx-form-panel__inner { padding: 18px 18px 40px; }
  .ecx-fields-row { grid-template-columns: 1fr; }
}
