/**
 * Vesty — Page Connexion (Split-Screen)
 * Charte : #A9CEF6, #F8FAFC, #1E293B, Satoshi/Inter, radius 12px / 80px
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ========== Variables ========== */
:root {
  --vesty-login-primary: #A9CEF6;
  --vesty-login-primary-hover: #95bde8;
  --vesty-login-form-bg: #F8FAFC;
  --vesty-login-text: #1E293B;
  --vesty-login-text-muted: #64748B;
  --vesty-login-radius: 12px;
  --vesty-login-radius-panel: 80px;
  --vesty-login-edge: 24px;
  --vesty-login-font: 'Satoshi', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --vesty-login-border: 1px solid #E2E8F0;
  --vesty-login-input-focus: #A9CEF6;
}

/* ========== Layout global (modale centrée) ========== */
.vesty-main:has(.vesty-login-wrap) {
  padding-left: 0;
  padding-right: 0;
  max-width: none;
}

.vesty-login-wrap {
  min-height: calc(100vh - 72px);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 2rem;
  box-sizing: border-box;
}

.vesty-login-modal {
  width: 100%;
  max-width: 960px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.vesty-login-container {
  display: flex;
  min-height: 560px;
  width: 100%;
  overflow: hidden;
}

/* ========== Panneau gauche (50%) — Image (légèrement rétrécie en bas) ========== */
.vesty-login-panel-image {
  flex: 0 0 50%;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  background: var(--vesty-login-form-bg);
}

.vesty-login-image-wrap {
  position: relative;
  width: 100%;
  height:100%;
  min-height: 380px;
  border-top-right-radius: var(--vesty-login-radius-panel);
  border-bottom-right-radius: var(--vesty-login-radius-panel);
  overflow: hidden;
}

.vesty-login-photo {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
  position: absolute;
  top: 0;
  left: 0;
}

/* Overlay : dégradé sombre en bas pour lisibilité logo + accroche */
.vesty-login-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.2) 40%,
    transparent 70%
  );
  pointer-events: none;
}

.vesty-login-overlay-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2.5rem 2.5rem 3rem;
  z-index: 1;
  pointer-events: none;
}

.vesty-login-overlay-tagline {
  font-family: var(--vesty-login-font);
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

/* ========== Panneau droit (50%) — Formulaire ========== */
.vesty-login-panel-form {
  width: 50%;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10%;
  background: var(--vesty-login-form-bg);
  font-family: var(--vesty-login-font);
}

.vesty-login-form-inner {
  width: 100%;
  max-width: 400px;
}

.vesty-login-form-logo {
  display: block;
  width: 100px;
  height: auto;
  margin-bottom: 2rem;
  color: var(--vesty-login-text);
}

.vesty-login-back-home {
  display: none;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0 0 1rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--vesty-login-primary);
  text-decoration: none;
  font-weight: 600;
}

.vesty-login-back-home:hover {
  text-decoration: underline;
}

.vesty-login-back-home:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(169, 206, 246, 0.35);
}

@media (display-mode: standalone) {
  .vesty-login-back-home {
    display: inline-flex;
  }
}

.vesty-login-back-home .material-symbols-rounded {
  font-size: 18px;
  color: var(--vesty-login-primary);
}

.vesty-login-form-inner h1 {
  font-family: var(--vesty-login-font);
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--vesty-login-text);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.vesty-login-form-inner .vesty-login-subtitle {
  font-size: 0.9375rem;
  color: var(--vesty-login-text-muted);
  margin: 0 0 2rem;
  line-height: 1.5;
}

/* ========== Formulaire ========== */
.vesty-login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.vesty-login-input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--vesty-login-font);
  font-size: 1rem;
  color: var(--vesty-login-text);
  background: #fff;
  border: var(--vesty-login-border);
  border-radius: var(--vesty-login-radius);
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* Remember Me Checkbox */
.vesty-login-remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: var(--vesty-login-text);
  cursor: pointer;
  user-select: none;
  margin: 0.25rem 0;
}

.vesty-login-remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--vesty-login-primary);
  margin: 0;
}

.vesty-login-remember-me span {
  line-height: 1.4;
}

.vesty-login-input::placeholder {
  color: #94A3B8;
}

.vesty-login-input:hover {
  border-color: #CBD5E1;
}

.vesty-login-input:focus {
  outline: none;
  border-color: var(--vesty-login-input-focus);
  box-shadow: 0 0 0 3px rgba(169, 206, 246, 0.25);
}

/* Bouton Magic Link */
.vesty-login-btn-primary {
  width: 100%;
  padding: 14px 20px;
  font-family: var(--vesty-login-font);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--vesty-login-primary);
  border: none;
  border-radius: var(--vesty-login-radius);
  cursor: pointer;
  transition: background 0.2s;
}

.vesty-login-btn-primary:hover {
  background: var(--vesty-login-primary-hover);
}

.vesty-login-btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

/* État micro-chargement */
.vesty-login-btn-primary.is-loading {
  pointer-events: none;
  position: relative;
  color: transparent;
}

.vesty-login-btn-primary.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: vesty-login-spin 0.7s linear infinite;
}

@keyframes vesty-login-spin {
  to { transform: rotate(360deg); }
}

/* Séparateur "ou" */
.vesty-login-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0;
}

.vesty-login-divider::before,
.vesty-login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E2E8F0;
}

.vesty-login-divider span {
  font-size: 0.75rem;
  color: var(--vesty-login-text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Bouton Google (style principal bleu, comme la ref) */
.vesty-login-btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  font-family: var(--vesty-login-font);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--vesty-login-primary);
  border: none;
  border-radius: var(--vesty-login-radius);
  cursor: pointer;
  transition: background 0.2s;
}

.vesty-login-btn-google:hover {
  background: var(--vesty-login-primary-hover);
}

.vesty-login-btn-google svg {
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

/* Messages */
.vesty-login-msg {
  font-size: 0.875rem;
  padding: 0.5rem 0;
  display: none;
}

.vesty-login-msg.success {
  color: #059669;
  display: none;
}

.vesty-login-msg.error {
  color: #DC2626;
  display: none;
}

.vesty-login-msg.visible {
  display: block;
}

/* Lien "Créer un compte" */
.vesty-login-link-box {
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: var(--vesty-login-text-muted);
}

.vesty-login-link-box a {
  color: var(--vesty-login-primary);
  font-weight: 500;
  text-decoration: none;
}

.vesty-login-link-box a:hover {
  text-decoration: underline;
}

/* ========== Responsive : mobile ========== */
@media (max-width: 767px) {
  .vesty-login-wrap {
    padding: 1rem;
    align-items: flex-start;
  }

  .vesty-login-modal {
    max-width: 100%;
    border-radius: 16px;
  }

  .vesty-login-container {
    flex-direction: column;
    min-height: auto;
  }

  .vesty-login-panel-image {
    display: none;
  }

  .vesty-login-panel-form {
    width: 100%;
    padding: 2rem 1.5rem;
    min-height: auto;
  }

  .vesty-login-form-inner {
    max-width: 100%;
  }
}


/* ── Tabs Magic Link / Mot de passe ── */
.vesty-auth-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
}

.vesty-auth-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: #64748b;
  transition: all 0.15s ease;
  font-family: inherit;
}

.vesty-auth-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ========== Mobile : éviter le double logo (header + splash) ========== */
@media (max-width: 767px) {
  .vesty-header .vesty-logo {
    /* Le splash PWA affiche aussi le logo -> chevauchement */
    display: none;
  }
}
