/* ============================================================
   ReptiManager — Auth CSS — Split layout (form left / image right)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary:       #22c55e;
  --primary-dark:  #16a34a;
  --primary-light: rgba(34,197,94,.12);
  --bg:            #0d1117;
  --card-bg:       #111827;
  --border:        rgba(255,255,255,.08);
  --text:          #f1f5f9;
  --text-muted:    #94a3b8;
  --radius:        14px;
}

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

body.auth-split {
  font-family: 'Inter', sans-serif;
  display: flex;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow: hidden; /* desktop : pas de scroll */
}
@media (max-width: 768px) {
  body.auth-split { overflow-y: auto !important; overflow-x: hidden; }
}

/* ── Panneau gauche : IMAGE ─────────────────────────────── */
.auth-left-img {
  flex: 1;
  position: relative;
  background-image: url('../img/fond_accueil_reptimanager.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  animation: fadeIn .7s ease .1s both;
}

/* ── Panneau droit : FORMULAIRE ─────────────────────────── */
.auth-right-form {
  flex: 0 0 480px;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  background: var(--bg);
  position: relative;
  z-index: 2;
  overflow-y: auto;
  max-height: 100vh;
  animation: slideInRight .55s cubic-bezier(.22,1,.36,1) both;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.auth-form-inner {
  width: 100%;
  max-width: 380px;
}

/* Logo */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 40px;
  animation: fadeInDown .45s ease .15s both;
}
.auth-logo-icon {
  width: 44px; height: 44px;
  background: var(--primary-light);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  border: 1px solid rgba(34,197,94,.2);
}
.auth-logo-name { font-size: 18px; font-weight: 800; color: var(--text); line-height: 1.2; }
.auth-logo-sub  { font-size: 11px; color: var(--text-muted); font-weight: 400; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.auth-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(13,17,23,.75) 0%,
    rgba(13,17,23,.35) 50%,
    rgba(13,17,23,.65) 100%
  );
}

.auth-img-text {
  position: absolute;
  bottom: 60px;
  left: 60px;
  right: 60px;
  z-index: 1;
  animation: slideInUp .6s cubic-bezier(.22,1,.36,1) .3s both;
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-img-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34,197,94,.15);
  border: 1px solid rgba(34,197,94,.3);
  color: #4ade80;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.auth-img-text h2 {
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 12px;
  text-shadow: 0 2px 20px rgba(0,0,0,.4);
}

.auth-img-text p {
  font-size: 15px;
  color: rgba(255,255,255,.7);
  line-height: 1.6;
  margin-bottom: 28px;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,.85);
  font-weight: 500;
}
.auth-feature i { color: #4ade80; font-size: 14px; flex-shrink: 0; }

/* ── Formulaire (card blanche dans le dark) ─────────────── */
.auth-card {
  background: #111827;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  animation: fadeInUp .45s ease .2s both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.auth-card .auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Alertes */
.alert,
.auth-alert {
  border-radius: 10px; padding: 12px 16px; font-size: 13px;
  margin-bottom: 16px; display: flex; gap: 8px; align-items: flex-start;
  animation: fadeInDown .3s ease both;
}
.alert-danger,  .auth-alert-danger  { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.25);  color: #fca5a5; }
.alert-success, .auth-alert-success { background: rgba(34,197,94,.12);  border: 1px solid rgba(34,197,94,.25);  color: #86efac; }
.alert-info,    .auth-alert-info    { background: rgba(14,165,233,.12); border: 1px solid rgba(14,165,233,.25); color: #7dd3fc; }
.alert-warning, .auth-alert-warning { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.25); color: #fcd34d; }

/* Formulaire */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: .3px;
}
.input-wrap { position: relative; }
.input-wrap .input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 15px; pointer-events: none;
}
.input-wrap .input-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: 15px; padding: 4px; transition: color .2s;
}
.input-wrap .input-eye:hover { color: var(--primary); }

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: border-color .2s, background .2s, box-shadow .2s;
  outline: none;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  border-color: var(--primary);
  background: rgba(34,197,94,.04);
  box-shadow: 0 0 0 3px rgba(34,197,94,.12);
}
.input-wrap .form-control { padding-left: 42px; }
.input-wrap .form-control.has-eye { padding-right: 42px; }

.form-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Bouton primaire */
.btn-auth {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  margin-top: 8px;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(34,197,94,.25);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-auth:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(34,197,94,.35);
}
.btn-auth:active { transform: translateY(0); }

/* Lien secondaire */
.auth-link {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.auth-link a:hover { text-decoration: underline; }

/* Séparateur */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.auth-divider::before,.auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Force password */
.pwd-strength { display: flex; gap: 4px; margin-top: 8px; }
.pwd-strength-bar {
  flex: 1; height: 3px; border-radius: 3px;
  background: rgba(255,255,255,.08);
  transition: background .3s;
}
.pwd-strength-bar.weak   { background: #ef4444; }
.pwd-strength-bar.medium { background: #f59e0b; }
.pwd-strength-bar.strong { background: var(--primary); }
.pwd-strength-text { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-align: right; }

/* Checkbox */
.form-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted); cursor: pointer;
}
.form-check input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px; height: 15px;
}

/* ── Logo lien dans le logo ─────────────────────────────── */
.auth-logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
  margin-bottom: 40px;
  animation: fadeInDown .45s ease .15s both;
}
.auth-logo-icon {
  width: 44px; height: 44px;
  background: var(--primary-light);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  border: 1px solid rgba(34,197,94,.2);
}
.auth-logo-name { font-size: 18px; font-weight: 800; color: var(--text); line-height: 1.2; }
.auth-logo-sub  { font-size: 11px; color: var(--text-muted); font-weight: 400; }

/* ── Responsive : mobile ────────────────────────────────── */
@media (max-width: 768px) {

  /* Image en fond de page avec overlay */
  body.auth-split {
    background-image: url('../img/fond_accueil_reptimanager.webp') !important;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    align-items: flex-start;
  }
  body.auth-split::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(13,17,23,.80);
    z-index: 0;
    pointer-events: none;
  }

  /* Cacher le panneau image */
  .auth-left-img { display: none; }

  /* Formulaire : toute la largeur, scroll libre */
  .auth-right-form {
    flex: 1;
    max-width: 100%;
    max-height: none !important; /* annule le max-height desktop */
    overflow-y: visible !important;
    padding: 24px 16px 40px;
    background: transparent;
    position: relative;
    z-index: 1;
    align-items: flex-start;
    justify-content: center;
  }

  .auth-form-inner { max-width: 440px; width: 100%; }

  /* Card légèrement transparente sur fond image */
  .auth-card {
    background: rgba(17,24,39,.90);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-color: rgba(255,255,255,.10);
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
  }
}

@media (max-width: 480px) {
  .auth-right-form { padding: 16px 12px 40px; }
  .auth-card       { padding: 22px 16px; }
}
