/* ============================================================
   CISKO GROUP — PRE-SESSION PAGES (Auth & Landing)
   Style premium moderne — Split-screen / Glassmorphism
   Compatible avec le design system principal (style.css)
   ============================================================ */

/* ============ FONT AWESOME ============ */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

/* ============ VARIABLES PROPRES AUX PAGES PRÉ-SESSION ============ */
:root {
  /* Palette premium — dégradé bleu/indigo/violet */
  --auth-primary: #4f46e5;
  --auth-primary-2: #3b82f6;
  --auth-accent: #6366f1;
  --auth-accent-2: #8b5cf6;
  --auth-dark: #0f172a;
  --auth-dark-2: #1e293b;
  --auth-slate: #64748b;
  --auth-slate-light: #94a3b8;
  --auth-bg: #f8fafc;
  --auth-surface: #ffffff;
  --auth-border: #e2e8f0;
  --auth-success: #10b981;
  --auth-danger: #ef4444;
  --auth-warning: #f59e0b;
  --auth-gradient: linear-gradient(135deg, #4f46e5 0%, #3b82f6 50%, #8b5cf6 100%);
  --auth-shadow: 0 20px 60px rgba(79, 70, 229, 0.15);
  --auth-shadow-sm: 0 4px 20px rgba(15, 23, 42, 0.08);
  --auth-radius: 20px;
  --auth-radius-sm: 12px;
}

/* ============ BASE ============ */
.auth-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--auth-bg);
  color: var(--auth-dark);
  min-height: 100vh;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ LAYOUT SPLIT-SCREEN ============ */
.auth-split {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* --- Colonne gauche : marque / image --- */
.auth-brand {
  flex: 1.1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 5vw, 4rem);
  background: var(--auth-gradient);
  color: #fff;
  overflow: hidden;
  min-height: 100vh;
}

/* Effets décoratifs (cercles, blobs) */
.auth-brand::before {
  content: '';
  position: absolute;
  top: -15%;
  right: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.auth-brand-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.auth-brand-name {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.auth-brand-name span {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.8;
  letter-spacing: 0.02em;
}

.auth-brand-hero {
  position: relative;
  z-index: 2;
  text-align: center;
  margin: 2rem 0;
}

.auth-brand-hero img {
  max-width: 100%;
  max-height: 60vh;
  border-radius: var(--auth-radius);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
  object-fit: contain;
  border: 4px solid rgba(255, 255, 255, 0.2);
}

.auth-brand-text {
  position: relative;
  z-index: 2;
  text-align: center;
}

.auth-brand-text h2 {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.auth-brand-text h2 em {
  font-style: normal;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.1em 0.3em;
  border-radius: 8px;
}

.auth-brand-text p {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  opacity: 0.9;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

.auth-brand-features {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.auth-brand-feature {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--auth-radius-sm);
  padding: 0.9rem 0.75rem;
  text-align: center;
  backdrop-filter: blur(8px);
  transition: transform 0.3s ease, background 0.3s ease;
}

.auth-brand-feature:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.18);
}

.auth-brand-feature i {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.4rem;
}

.auth-brand-feature span {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.9;
}

.auth-brand-bottom {
  position: relative;
  z-index: 2;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.85;
}

.auth-brand-bottom i {
  margin-right: 0.4rem;
}

/* --- Colonne droite : formulaire --- */
.auth-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--auth-bg);
  position: relative;
}

.auth-form-wrap {
  width: 100%;
  max-width: 440px;
  animation: authFadeInUp 0.6s ease-out both;
}

.auth-card {
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  padding: clamp(1.8rem, 4vw, 2.5rem);
  box-shadow: var(--auth-shadow);
}

.auth-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--auth-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.6rem;
  margin: 0 auto 1.25rem;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}

.auth-card h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0 0 0.5rem;
  color: var(--auth-dark);
}

.auth-subtitle {
  text-align: center;
  color: var(--auth-slate);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

/* --- Champs de formulaire --- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field {
  position: relative;
}

.auth-field i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--auth-slate-light);
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.3s ease;
}

.auth-field input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 2.75rem;
  background: var(--auth-bg);
  border: 1.5px solid var(--auth-border);
  border-radius: var(--auth-radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--auth-dark);
  transition: all 0.3s ease;
}

.auth-field input::placeholder {
  color: var(--auth-slate-light);
}

.auth-field input:focus {
  outline: none;
  border-color: var(--auth-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.auth-field input:focus + i,
.auth-field:focus-within i {
  color: var(--auth-primary);
}

/* Champs OTP (code) */
.auth-field.code input {
  text-align: center;
  letter-spacing: 0.4rem;
  font-size: 1.4rem;
  font-weight: 700;
  padding-left: 1rem;
}

/* --- Boutons --- */
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.95rem 1.5rem;
  background: var(--auth-gradient);
  color: #fff;
  border: none;
  border-radius: var(--auth-radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
  margin-top: 0.25rem;
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.4);
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-btn i {
  font-size: 1rem;
}

/* --- Bouton secondaire / lien --- */
.auth-link-row {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--auth-slate);
}

.auth-link-row a {
  color: var(--auth-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

.auth-link-row a:hover {
  color: var(--auth-accent-2);
  text-decoration: underline;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  color: var(--auth-slate);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.3s ease;
  width: 100%;
}

.auth-back-link:hover {
  color: var(--auth-primary);
}

/* --- Note de sécurité --- */
.auth-security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--auth-slate);
  text-align: center;
}

.auth-security-note i {
  color: var(--auth-success);
}

/* --- Flash/toasts --- */
.auth-messages {
  margin-bottom: 1.25rem;
}

.auth-alert {
  padding: 0.85rem 1rem;
  border-radius: var(--auth-radius-sm);
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  line-height: 1.4;
}

.auth-alert i {
  margin-top: 2px;
}

.auth-alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.auth-alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.auth-alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.auth-alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* --- Minuteur OTP --- */
.auth-timer {
  text-align: center;
  margin: 1.25rem 0;
  padding: 0.9rem;
  background: var(--auth-bg);
  border-radius: var(--auth-radius-sm);
  border: 1px dashed var(--auth-border);
}

.auth-timer-label {
  font-size: 0.8rem;
  color: var(--auth-slate);
  margin-bottom: 0.3rem;
}

.auth-timer-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--auth-primary);
  letter-spacing: 0.05em;
}

.auth-timer-value.bloque {
  color: var(--auth-danger);
}

.auth-cooldown {
  text-align: center;
  font-size: 0.85rem;
  color: var(--auth-slate);
  margin-top: 0.5rem;
}

.auth-resend-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1rem;
  padding: 0.8rem;
  background: transparent;
  border: 1.5px solid var(--auth-border);
  border-radius: var(--auth-radius-sm);
  color: var(--auth-primary);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
}

.auth-resend-btn:hover:not(:disabled) {
  border-color: var(--auth-primary);
  background: rgba(79, 70, 229, 0.05);
}

.auth-resend-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Footer marque (mobile) --- */
.auth-mobile-brand {
  display: none;
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-mobile-brand img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: contain;
  margin: 0 auto 0.75rem;
  box-shadow: var(--auth-shadow-sm);
}

.auth-mobile-brand h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  color: var(--auth-dark);
}

.auth-mobile-brand p {
  font-size: 0.85rem;
  color: var(--auth-slate);
  margin: 0.25rem 0 0;
}

/* --- Badge "développé par RT COMPANY" --- */
.auth-rt-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.5rem 1rem;
  background: var(--auth-bg);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-full, 9999px);
  font-size: 0.8rem;
  color: var(--auth-slate);
}

.auth-rt-badge i {
  color: var(--auth-primary);
}

/* ============ ANIMATIONS ============ */
@keyframes authFadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes authFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.auth-float {
  animation: authFloat 4s ease-in-out infinite;
}

/* ============ RESPONSIVE (mobile-first — cible principale) ============ */
@media (max-width: 900px) {
  .auth-split {
    flex-direction: column;
  }

  /* Colonne marque : en-tête compact mais attrayant */
  .auth-brand {
    min-height: auto;
    padding: 1.25rem 1.5rem;
    background: var(--auth-gradient);
    border-radius: 0 0 28px 28px;
    box-shadow: 0 10px 40px rgba(79, 70, 229, 0.25);
    position: relative;
    overflow: hidden;
  }

  /* Effet décoratif mobile */
  .auth-brand::before,
  .auth-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
  }
  .auth-brand::before {
    top: -60%;
    right: -20%;
    width: 240px;
    height: 240px;
  }
  .auth-brand::after {
    bottom: -80%;
    left: -10%;
    width: 200px;
    height: 200px;
  }

  .auth-brand-top {
    justify-content: center;
    gap: 0.6rem;
  }

  .auth-brand-logo {
    width: 44px;
    height: 44px;
  }

  .auth-brand-name {
    font-size: 1.25rem;
  }

  .auth-brand-name span {
    font-size: 0.7rem;
  }

  /* Badge RT COMPANY intégré dans l'en-tête mobile */
  .auth-brand-top {
    position: relative;
  }
  .auth-brand-top::after {
    content: 'Développé par RT COMPANY';
    position: absolute;
    bottom: -1.1rem;
    font-size: 0.65rem;
    font-weight: 500;
    opacity: 0.85;
    letter-spacing: 0.03em;
    white-space: nowrap;
  }

  /* Masqué sur mobile pour alléger l'en-tête */
  .auth-brand-hero,
  .auth-brand-text,
  .auth-brand-features,
  .auth-brand-bottom,
  .auth-mobile-brand {
    display: none;
  }

  /* Colonne formulaire : pleine largeur, centrée, avec marge sous l'en-tête */
  .auth-form-side {
    padding: 1.75rem 1rem 2rem;
    min-height: auto;
    align-items: flex-start;
    justify-content: center;
  }

  .auth-form-wrap {
    max-width: 480px;
    margin: 0 auto;
  }

  .auth-card {
    border-radius: 20px;
    padding: 1.75rem;
  }

  /* Boutons plus grands et tactiles */
  .auth-btn {
    padding: 1rem 1.5rem;
    font-size: 1.05rem;
    min-height: 52px;
  }

  .auth-field input {
    padding: 1rem 1rem 1rem 2.9rem;
    min-height: 52px;
    font-size: 1rem;
  }

  .auth-field i {
    font-size: 1.1rem;
  }

  .auth-card-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
}

/* Très petits écrans (≤ 400px) */
@media (max-width: 400px) {
  .auth-brand {
    padding: 1rem 1.25rem;
    border-radius: 0 0 22px 22px;
  }

  .auth-brand-logo {
    width: 40px;
    height: 40px;
  }

  .auth-brand-name {
    font-size: 1.1rem;
  }

  .auth-form-side {
    padding: 1.25rem 0.75rem 1.5rem;
  }

  .auth-card {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .auth-card h2 {
    font-size: 1.35rem;
  }

  .auth-card-icon {
    width: 54px;
    height: 54px;
    font-size: 1.35rem;
    margin-bottom: 1rem;
  }

  .auth-subtitle {
    font-size: 0.9rem;
  }

  .auth-field input {
    font-size: 1rem;
  }

  .auth-btn {
    font-size: 1rem;
    min-height: 50px;
  }

  .auth-mobile-brand img {
    width: 64px;
    height: 64px;
  }

  .auth-mobile-brand h1 {
    font-size: 1.35rem;
  }
}
