/* ============================================================
   VECTA — Point d'entrée (Connexion / Inscription)
   Fichier : modules/auth/auth.css
   Thème clair — Palette officielle : blanc + bleu
   ============================================================ */

body {
  /* base commune (min-height, bg, color, font) : voir shared/styles/base.css */
  display: flex;
  flex-direction: column;
}

/* ─── Layout général : mobile = 1 colonne, desktop = split 2 colonnes ─── */
.vc-layout {
  flex: 1;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ─── Colonne formulaire ─────────────────────────────────────── */
.vc-form-col {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;   /* part du haut ; le centrage vertical n'est appliqué qu'en desktop, voir media query */
  padding: 32px 16px 60px;
}
.vc-form-col > * { width: 100%; max-width: 420px; }

/* ─── Colonne illustration (visible desktop seulement) ─────────── */
.vc-illustration-col {
  display: none;
}

/* ─── Hero ────────────────────────────────────────────────── */
.vc-hero { text-align: left; padding: 4px 2px 8px; }
.vc-title {
  font-size: 26px; font-weight: 700; color: var(--text);
  letter-spacing: -0.5px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.vc-title-logo { height: 40px; width: auto; object-fit: contain; }
.vc-title-word { display: flex; align-items: baseline; gap: 2px; }
.vc-title-word .accent { color: var(--vecta-blue-light); }
.vc-sub { font-size: 13.5px; color: var(--text-muted); margin-top: 6px; font-weight: 400; }

/* ─── Tabs ────────────────────────────────────────────────── */
.vc-tabs {
  display: flex;
  gap: 4px;
  margin: 24px auto 0;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.vc-tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: color .2s, background .2s, box-shadow .2s;
  font-family: 'Inter', sans-serif;
}
.vc-tab.active {
  color: var(--vecta-blue-dark);
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}
.vc-tab:not(.active):hover { color: var(--text-secondary); }

/* ─── Card / form ─────────────────────────────────────────── */
.vc-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 24px 2px 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.vc-field { display: flex; flex-direction: column; gap: 7px; position: relative; }
.vc-field:focus-within .vc-label { color: var(--text); }
.vc-label { font-size: 13px; font-weight: 700; color: var(--text-secondary); transition: color .2s; }
.vc-label .opt { font-weight: 500; color: var(--text-muted); text-transform: none; }

.vc-input-wrap { position: relative; display: flex; align-items: center; }
.vc-input-wrap > svg {
  position: absolute; right: 2px;
  width: 16px; height: 16px;
  stroke: var(--text-muted); stroke-width: 1.8; fill: none;
  pointer-events: none;
  transition: stroke .2s;
}
.vc-input-wrap:focus-within > svg { stroke: var(--vecta-blue-light); }
.vc-input {
  width: 100%; height: 44px;
  padding: 0 26px 0 4px;
  border: none;
  border-bottom: 1.5px solid var(--border);
  border-radius: 0;
  font-size: 14.5px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  color: var(--text);
  background: transparent;
  outline: none;
  transition: border-color .2s, border-bottom-width .2s;
  appearance: none;
}
.vc-input::placeholder { color: var(--text-muted); }
.vc-input:focus { border-bottom-color: var(--vecta-blue-light); border-bottom-width: 2px; }
.vc-input.error { border-bottom-color: var(--danger); }

.vc-toggle-pw {
  position: absolute; right: 4px;
  background: none; border: none;
  cursor: pointer; padding: 0;
  display: flex; align-items: center;
  z-index: 1;
}
.vc-toggle-pw svg { width: 17px; height: 17px; stroke: var(--text-muted); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s; }
.vc-toggle-pw:hover svg { stroke: var(--vecta-blue-light); }
.vc-input-wrap:has(.vc-toggle-pw) > svg:not(.vc-toggle-pw svg) { display: none; }

.vc-hint { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.vc-err  { font-size: 12px; color: var(--danger); font-weight: 600; display: none; }
.vc-err.show { display: block; }

/* ─── Dropdown custom (remplace les <select> natifs) ─────────── */
.vc-dropdown { position: relative; }
.vc-dropdown-trigger {
  width: 100%; height: 44px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
  border: none;
  border-bottom: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  font-weight: 400;
  color: var(--text);
  text-align: left;
  transition: border-color .2s, border-bottom-width .2s;
}
.vc-dropdown-trigger .placeholder { color: var(--text-muted); }
.vc-dropdown-trigger .flag { margin-right: 6px; }
.vc-dropdown-trigger svg {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: var(--text-muted); stroke-width: 2; fill: none;
  transition: transform .2s, stroke .2s;
}
.vc-dropdown.open .vc-dropdown-trigger { border-bottom-color: var(--vecta-blue-light); border-bottom-width: 2px; }
.vc-dropdown.open .vc-dropdown-trigger svg { transform: rotate(180deg); stroke: var(--vecta-blue-light); }
.vc-dropdown.error .vc-dropdown-trigger { border-bottom-color: var(--danger); }

.vc-dropdown-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(20,30,60,.14);
  z-index: 60;
  padding: 6px;
}
.vc-dropdown.open .vc-dropdown-panel { display: block; }
.vc-dropdown-option {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 10px;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
}
.vc-dropdown-option:hover,
.vc-dropdown-option.highlighted { background: var(--vecta-blue-pale); }
.vc-dropdown-option.selected { font-weight: 700; color: var(--vecta-blue); }

/* ─── "Besoin d'aide ?" ──────────────────────────────────────── */
.vc-help {
  position: relative;
  margin: 20px auto 0;
  text-align: center;
}
.vc-help-link {
  border: none;
  background: transparent;
  padding: 6px 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: color .15s;
}
.vc-help-link:hover { color: var(--vecta-blue); }
.vc-help-menu {
  display: none;
  flex-direction: column;
  gap: 2px;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0 auto;
  width: fit-content;
  min-width: 220px;
  max-width: calc(100vw - 40px);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(20,30,60,.14);
  padding: 6px;
  z-index: 60;
}
.vc-help-menu.show { display: flex; }
.vc-help-option {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  text-align: left;
  transition: background .15s, color .15s;
}
.vc-help-option:hover { background: var(--vecta-blue-pale); color: var(--vecta-blue); }

/* ─── Ligne à deux colonnes (ex: pays / effectif) ───────────── */
.vc-row-2 { display: flex; gap: 14px; }
.vc-row-2 > .vc-field { flex: 1; min-width: 0; }

/* ─── Indicatif téléphone dynamique ─────────────────────────── */
.vc-input-wrap-phone { gap: 8px; }
.vc-phone-prefix {
  flex-shrink: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1.5px solid var(--border);
  height: 44px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 6px;
  transition: color .2s;
}
.vc-input-wrap-phone:focus-within .vc-phone-prefix { color: var(--vecta-blue-light); }
.vc-input-phone { padding-left: 0; }

/* ─── Indicateur de force du mot de passe ───────────────────── */
.vc-strength { display: flex; align-items: center; gap: 10px; }
.vc-strength-bars { display: flex; gap: 4px; flex: 0 0 auto; }
.vc-strength-bar {
  width: 28px; height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background .2s;
}
.vc-strength-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color .2s;
}

/* ─── Lien mot de passe oublié ──────────────────────────────── */
.vc-forgot-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  cursor: pointer;
  padding: 0;
  margin-top: -8px;
  font-family: 'Inter', sans-serif;
  align-self: flex-end;
}
.vc-forgot-link:hover { color: var(--vecta-blue-light); text-decoration: underline; }

/* ─── Case consentement CGU / Confidentialité ───────────────── */
.vc-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.vc-consent-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  margin-top: 0;
  flex-shrink: 0;
  border: 1.5px solid var(--text-muted);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s;
}
.vc-consent-checkbox:checked {
  background: linear-gradient(135deg, var(--vecta-blue-light), var(--vecta-blue));
  border-color: var(--vecta-blue-light);
}
.vc-consent-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 6px; top: 2px;
  width: 5px; height: 10px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.vc-consent-checkbox.error { border-color: var(--danger); }
.vc-consent-label {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  font-weight: 400;
  cursor: pointer;
}
.vc-consent-label a {
  color: var(--vecta-blue-light);
  font-weight: 600;
  text-decoration: underline;
}
.vc-consent-label a:hover { color: var(--vecta-blue-dark); }

/* ─── Bouton principal ────────────────────────────────────── */
.vc-btn {
  height: 50px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--vecta-blue-light), var(--vecta-blue) 60%, var(--vecta-blue-dark));
  color: #FFFFFF;
  font-size: 14.5px; font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: none;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  margin-top: 4px;
  position: relative;
}
.vc-btn:hover  { opacity: .92; box-shadow: 0 8px 22px rgba(29,62,140,.28); }
.vc-btn:active { transform: scale(.98); box-shadow: none; }
.vc-btn:disabled { opacity: .5; cursor: not-allowed; }
.vc-btn svg { width: 16px; height: 16px; stroke: #FFFFFF; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.vc-loader {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: vc-spin .7s linear infinite;
}
@keyframes vc-spin { to { transform: rotate(360deg); } }

/* ─── Séparateur de section (inscription) ───────────────────── */
.vc-section-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--vecta-blue-light);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 4px 0 -6px;
}

/* ─── États de chargement (gérés en JS via display) ───────── */
#btn-login[disabled] #btn-login-ico,
#btn-register[disabled] #btn-register-ico { display: none; }

/* ─── Toast simple ──────────────────────────────────────────── */
.vc-toast {
  position: fixed;
  bottom: 24px; left: 0; right: 0;
  margin: 0 auto;
  width: fit-content;
  transform: translateY(20px);
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(20,30,60,.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 999;
  max-width: calc(100vw - 40px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.vc-toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.vc-toast.success { border-color: var(--success); }
.vc-toast.error   { border-color: var(--danger); }

/* ─── Responsive tablette ─────────────────────────────────── */
@media (min-width: 640px) {
  .vc-form-col { padding: 20px 14px 50px; }
  .vc-card  { padding: 22px 2px 0; }
}

/* ─── Desktop : split 2 colonnes, formulaire à gauche ───────── */
@media (min-width: 980px) {
  html, body { height: 100%; }
  body { overflow: hidden; }           /* le scroll se fait dans .vc-form-col, pas sur la page entière */

  .vc-layout {
    flex-direction: row;
    height: 100vh;
    height: 100dvh;
  }

  .vc-form-col {
    flex: 0 0 46%;
    max-width: 620px;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 40px 64px;
    height: 100%;
    overflow-y: auto;                  /* le formulaire défile seul dans sa colonne */
  }
  .vc-form-col > * { max-width: 420px; }

  .vc-title { font-size: 30px; }
  .vc-title-logo { height: 46px; }
  .vc-input { padding-left: 2px; }
  .vc-btn { height: 50px; }

  .vc-illustration-col {
    display: flex;
    flex: 1;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--vecta-blue-pale) 0%, #E4EAF9 100%);
    position: relative;
    overflow: hidden;                  /* ne défile jamais : reste fixe pendant le scroll du formulaire */
  }
  .vc-illustration-content {
    max-width: 460px;
    padding: 48px;
    text-align: center;
    position: relative;
    z-index: 2;
  }
  .vc-illustration-content img {
    width: 100%;
    max-width: 360px;
    height: auto;
    margin-bottom: 28px;
  }
  .vc-illustration-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--vecta-blue-dark);
    margin-bottom: 10px;
    letter-spacing: -.3px;
  }
  .vc-illustration-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
  }
  /* Décor géométrique discret en arrière-plan, dérivé du "V" du logo */
  .vc-illustration-col::before {
    content: '';
    position: absolute;
    width: 640px; height: 640px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(46,85,184,.10), transparent 60%);
    top: -120px; right: -160px;
  }
}
