/* ══ VARIABLES ═══════════════════════════════════════════════════ */
:root {
  --orange:    #EF7900;
  --orange-lt: #FFF3E6;
  --navy:      #0D1A8C;
  --navy-lt:   #EEF1FF;
  --dark:      #1F2937;
  --gray-bg:   #F3F4F6;
  --gray-brd:  #E5E7EB;
  --text:      #111827;
  --muted:     #6B7280;
  --red:       #EF4444;
  --red-lt:    #FEE2E2;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100%;
  background: var(--gray-bg);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
}

/* ══ TOPBAR ══════════════════════════════════════════════════════ */
.topbar {
  background: var(--navy);
  padding: 14px 18px 12px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(13,26,140,.25);
}
.topbar-back {
  background: rgba(255,255,255,.1); border: none; border-radius: 7px;
  padding: 6px 10px; color: rgba(255,255,255,.8); font-size: 18px;
  cursor: pointer; text-decoration: none;
  display: flex; align-items: center; transition: background .15s;
  flex-shrink: 0;
}
.topbar-back:hover { background: rgba(255,255,255,.18); }
.topbar-title { font-size: 15px; font-weight: 700; color: #fff; }

/* ══ PAGE ════════════════════════════════════════════════════════ */
.page {
  max-width: 500px; margin: 0 auto;
  padding: 17px 11px 48px;
}

/* ── En-tête ────────────────────────────────────────────────────── */
.page-heading {
  text-align: center;
  font-size: 22px; font-weight: 800; color: #1a1a2e;
  margin-bottom: 8px;
}
.page-sub {
  text-align: center; font-size: 14px; color: var(--muted);
  margin-bottom: 24px; line-height: 1.5;
}

/* ── Onglets ─────────────────────────────────────────────────────── */
.tabs-wrap {
  display: flex; background: #E9EBF8; border-radius: 50px;
  padding: 4px; margin-bottom: 24px; gap: 4px;
}
.tab-btn {
  flex: 1; padding: 9px 0;
  border: none; border-radius: 50px; cursor: pointer;
  font-size: 14px; font-weight: 700; transition: all .2s;
  background: transparent; color: var(--muted);
}
.tab-btn.active {
  background: #fff; color: var(--navy);
  box-shadow: 0 1px 6px rgba(13,26,140,.12);
}

/* ── Contenu des onglets ────────────────────────────────────────── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Alerte globale ─────────────────────────────────────────────── */
.auth-alert {
  display: none;
  background: var(--red-lt); color: #991B1B;
  border-radius: 10px; padding: 11px 14px;
  font-size: 13px; font-weight: 600; margin-bottom: 16px;
}

/* ── Formulaire ─────────────────────────────────────────────────── */
.form-group  { margin-bottom: 14px; }
.form-label  {
  display: block; font-size: 13px; font-weight: 600;
  color: #374151; margin-bottom: 5px;
}
.form-label .req { color: var(--red); }
.form-input {
  width: 100%; padding: 11px 13px;
  border: 1.5px solid var(--gray-brd); border-radius: 10px;
  font-size: 14px; color: var(--text); background: #FAFAFA;
  outline: none; transition: border-color .2s; font-family: inherit;
}
.form-input:focus { border-color: var(--navy); }
.form-input-hint {
  font-size: 11px; color: var(--muted); margin-top: 5px; display: block;
}
.form-error {
  font-size: 12px; color: var(--red); margin-top: 4px; display: none;
}

/* ── Champ mot de passe avec icône ──────────────────────────────── */
.input-group {
  display: flex; border: 1.5px solid var(--gray-brd); border-radius: 10px;
  overflow: hidden; background: #FAFAFA; transition: border-color .2s;
}
.input-group:focus-within { border-color: var(--navy); }
.input-group .form-input {
  border: none; border-radius: 0; flex: 1;
  background: transparent;
}
.input-group .form-input:focus { border: none; }
.toggle-password {
  background: none; border: none; cursor: pointer;
  padding: 0 13px; color: var(--muted); display: flex; align-items: center;
  transition: color .15s; flex-shrink: 0;
}
.toggle-password:hover { color: var(--navy); }

/* ── Options connexion ──────────────────────────────────────────── */
.login-options {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.check-wrap {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text); cursor: pointer;
}
.check-wrap input[type=checkbox] {
  width: 15px; height: 15px; accent-color: var(--navy);
  cursor: pointer; flex-shrink: 0;
}
.forgot-link {
  font-size: 13px; color: var(--navy); text-decoration: none; font-weight: 600;
}
.forgot-link:hover { text-decoration: underline; }

/* ── Grille 2 colonnes ───────────────────────────────────────────── */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
@media (max-width: 380px) { .form-row-2 { grid-template-columns: 1fr; } }

/* ── Bouton de soumission ────────────────────────────────────────── */
.btn-submit {
  width: 100%; padding: 14px;
  background: var(--navy); color: #fff;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background .15s; margin-top: 4px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-submit:hover    { background: #0a1470; }
.btn-submit:disabled { background: var(--gray-brd); color: var(--muted); cursor: not-allowed; }
.spinner {
  display: none; width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── CGU ─────────────────────────────────────────────────────────── */
.cgu-text {
  text-align: center; font-size: 12px; color: var(--muted);
  margin-top: 14px; line-height: 1.6;
}
.cgu-text a { color: var(--orange); text-decoration: none; font-weight: 600; }
.cgu-text a:hover { text-decoration: underline; }

/* ── Séparateur artisan ──────────────────────────────────────────── */
.artisan-sep {
  border-top: 1px solid var(--gray-brd);
  margin-top: 28px; padding-top: 20px; text-align: center;
}
.artisan-sep p {
  font-size: 12px; color: var(--muted); margin-bottom: 10px;
}
.btn-artisan {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 20px; border-radius: 8px;
  border: 1.5px solid var(--orange); color: var(--orange);
  background: transparent; font-size: 13px; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: background .15s;
}
.btn-artisan:hover { background: var(--orange-lt); }

/* ── Aide ────────────────────────────────────────────────────────── */
.help-text {
  text-align: center; font-size: 12px; color: var(--muted); margin-top: 16px;
}
.help-text a { color: var(--navy); text-decoration: none; font-weight: 600; }
.help-text a:hover { text-decoration: underline; }

/* ── Toast ────────────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark); color: #fff;
  padding: 11px 20px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  opacity: 0; transition: all .25s;
  pointer-events: none; z-index: 500; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Champ téléphone avec indicatif ─────────────────────────────── */
.phone-wrap { position: relative; margin-bottom: 22px;}
.phone-prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 5px;
  pointer-events: none; z-index: 1;
}
.phone-flag { font-size: 17px; line-height: 1; }
.phone-code { font-size: 14px; font-weight: 700; color: #374151; white-space: nowrap; }
.form-input--phone { padding-left: 90px !important; }


/* ── Séparateur ── */
    .sep { display:flex; align-items:center; gap:12px; margin-bottom:18px; }
    .sep-line { flex:1; height:1px; background:#EAEAF4; }
    .sep-txt  { font-size:12px; color:#C0C0D8; white-space:nowrap; }

    /* ── Boutons sociaux ── */
    .socials { display:flex; gap:10px; margin-bottom:22px; }
    .soc-btn {
      flex:1;
      display:flex; align-items:center; justify-content:center; gap:5px;
      padding: 10px 6px;
      border: 1.5px solid #E8E8F2;
      border-radius: 10px;
      font-size: 12px; font-weight: 600;
      cursor: pointer; background: #fff;
      text-decoration: none;
      transition: border-color 0.2s, background 0.2s;
    }
    .soc-btn:hover { border-color:#C0C0E0; background:#F7F7FD; }
    .soc-fb { color:#1877F2; }
    .soc-gg { color:#EA4335; }
    .soc-ap { color:#111; }

    /* ── Termes ── */
    .terms {
      font-size: 11px; color: #BBBBCC;
      text-align: center; line-height: 1.6;
      margin-bottom: 20px;
    }
    .terms a { color:#1B1D8F; text-decoration:none; }
    .terms a:hover { text-decoration:underline; }

    /* ── Bloc aide ── */
    .help {
      display:flex; align-items:center; gap:10px;
      background:#F4F4FD; border-radius:10px; padding:12px 14px;
    }
    .help-ico {
      width:34px; height:34px; border-radius:50%;
      background:#1B1D8F;
      display:flex; align-items:center; justify-content:center; flex-shrink:0;
    }
    .help-ico svg { width:16px; height:16px; stroke:#fff; fill:none; stroke-width:2; stroke-linecap:round; }
    .help-txt { font-size:11px; color:#888; line-height:1.5; }
    .help-txt a { color:#1B1D8F; font-weight:600; text-decoration:none; }
    .help-txt strong { color:#333; }
