/* ==========================================================================
   ÉCRANS D'AUTHENTIFICATION
   Connexion (M01, P02, O01) + Inscription (P01) + Bienvenue (P13)
   ========================================================================== */

.auth-screen {
  width: 100%;
  height: 100%;
  display: flex;
  overflow: hidden;
}

/* ==========================================================================
   LAYOUT DESKTOP — M01 Connexion Médecin
   Formulaire centré, sobre, sans branding ni promo produit
   ========================================================================== */

.auth-screen--desktop {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--color-bg-soft) 0%, var(--color-bg) 100%);
  padding: var(--space-8);
  overflow: hidden;
}

.auth-screen--desktop .auth-desktop-card {
  width: 100%;
  max-width: 440px;
  background: transparent;
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
}

.auth-screen--desktop .auth-desktop-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.auth-desktop-brand__logo {
  width: 115px;
  height: 115px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-desktop-brand__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-desktop-card__title {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  color: var(--color-gray-dark);
  text-align: center;
  margin-bottom: var(--space-2);
}

.auth-desktop-card__subtitle {
  font-size: var(--fs-sm);
  color: var(--color-gray);
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-desktop-card__fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.auth-desktop-card__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.auth-desktop-card__footer {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  font-size: var(--fs-xs);
  color: var(--color-gray-light);
  text-align: center;
  line-height: 1.5;
}

.auth-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}


/* ---------- Classes partagées réutilisées par les layouts mobile/tablette ---------- */

.auth-form-side__fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.auth-form-side__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ==========================================================================
   M01 SUR TABLETTE — Médecin avec écran tablette
   Réutilise la card desktop avec un layout adapté à la tablette
   ========================================================================== */

.auth-screen--tablet-pro {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--color-bg-soft) 0%, var(--color-bg) 100%);
  padding: var(--space-8);
  height: 100%;
  overflow: hidden;
}

.auth-screen--tablet-pro .auth-desktop-card {
  width: 100%;
  max-width: 520px;
  background: transparent;
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
}

/* Sur tablette, on agrandit légèrement le logo et les inputs (touch-friendly) */
.auth-screen--tablet-pro .auth-desktop-brand {
  margin-bottom: var(--space-8);
}

.auth-screen--tablet-pro .auth-desktop-brand__logo {
  width: 145px;
  height: 145px;
  margin: 0 auto;
}

.auth-screen--tablet-pro .auth-desktop-card__title {
  font-size: var(--fs-2xl);
}

.auth-screen--tablet-pro .input {
  height: 52px;
  font-size: var(--fs-md);
}

.auth-screen--tablet-pro .btn--large {
  height: 56px;
  font-size: var(--fs-md);
}

/* ==========================================================================
   O01 SUR DESKTOP — Officine avec écran ordinateur
   Réutilise la card tablette avec un layout adapté au desktop
   ========================================================================== */

.auth-screen--desktop-pro {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #E8F1FB 0%, #F2F2F2 100%);
  padding: var(--space-8);
  height: 100%;
  overflow: hidden;
}

.auth-screen--desktop-pro .auth-tablet-card {
  background: transparent;
  padding: var(--space-6) var(--space-4);
  width: 480px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

/* Sur desktop, on resserre un peu : padding plus modéré, header plus compact */
.auth-screen--desktop-pro .auth-tablet-header {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
}

.auth-screen--desktop-pro .auth-tablet-header__logo {
  width: 44px;
  height: 44px;
}

.auth-screen--desktop-pro .auth-tablet-header__logo img {
  width: 32px;
  height: 32px;
}

.auth-screen--desktop-pro .auth-tablet-card__title {
  font-size: var(--fs-xl);
}

.auth-screen--desktop-pro .input--large {
  height: 44px;
  font-size: var(--fs-base);
}

.auth-screen--desktop-pro .btn--large {
  height: 44px;
  font-size: var(--fs-base);
}

/* ==========================================================================
   LAYOUT MOBILE — P01, P02, P13
   Un seul écran vertical, header + corps + footer
   ========================================================================== */

.auth-screen--mobile {
  flex-direction: column;
  background: var(--color-surface);
  height: 100%;
}

.auth-screen--mobile .auth-mobile-header {
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
}

.auth-mobile-back {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray-dark);
  background: var(--color-bg);
  transition: background var(--dur-fast) var(--ease-out);
}

.auth-mobile-back:hover {
  background: var(--color-gray-border);
}

.auth-mobile-header__title {
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--color-gray-dark);
}

.auth-mobile-header__spacer {
  width: 36px;
}

.auth-screen--mobile .auth-mobile-body {
  flex: 1;
  padding: var(--space-4) var(--space-6) var(--space-8);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.auth-mobile-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  margin-top: var(--space-4);
}

.auth-mobile-brand__logo {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-mobile-brand__logo img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.auth-mobile-brand__name {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--color-primary);
  letter-spacing: 0.5px;
}

.auth-mobile-title {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  color: var(--color-gray-dark);
  margin-bottom: var(--space-2);
  text-align: center;
}

.auth-mobile-subtitle {
  font-size: var(--fs-sm);
  color: var(--color-gray);
  margin-bottom: var(--space-6);
  text-align: center;
  line-height: 1.5;
}

.auth-screen--mobile .auth-form-side__fields {
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.auth-screen--mobile .auth-form-side__actions {
  margin-top: auto;
  padding-top: var(--space-4);
}

/* Sur mobile, le bloc "Pas encore de compte ? · Créer un compte" en pied
   de formulaire est centré. Pour les autres usages (label + lien "Oublié ?"),
   le space-between hérité reste actif. */
.auth-screen--mobile .auth-form-side__actions .auth-between {
  margin-top: var(--space-4);
  justify-content: center;
  font-size: var(--fs-sm);
  color: var(--color-gray);
}

/* ==========================================================================
   LAYOUT TABLETTE — O01 Connexion Officine
   Card centrée avec fond bleu
   ========================================================================== */

.auth-screen--tablet {
  background: linear-gradient(135deg, #E8F1FB 0%, #F2F2F2 100%);
  padding: var(--space-6);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.auth-screen--tablet .auth-tablet-card {
  background: transparent;
  padding: var(--space-6) var(--space-4);
  width: 560px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

.auth-screen--tablet .auth-tablet-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-gray-border);
}

.auth-tablet-header__logo {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-tablet-header__logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.auth-tablet-header__info {
  flex: 1;
}

.auth-tablet-header__brand {
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--color-primary);
  letter-spacing: 0.5px;
}

.auth-tablet-header__pharmacy {
  font-size: var(--fs-sm);
  color: var(--color-gray);
  margin-top: 2px;
}

.auth-tablet-card__title {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold);
  color: var(--color-gray-dark);
  margin-bottom: var(--space-2);
}

.auth-tablet-card__subtitle {
  font-size: var(--fs-sm);
  color: var(--color-gray);
  margin-bottom: var(--space-6);
  line-height: 1.5;
}

.auth-tablet-card__fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.auth-tablet-card__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.auth-tablet-footer {
  margin-top: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--color-gray-light);
}

.auth-tablet-footer__secured {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-gray-border);
  border-radius: var(--radius-full);
  color: var(--color-gray);
}

.auth-tablet-footer__secured svg {
  color: var(--color-success);
}

/* ---------- Sélecteur pharmacien (O01) ---------- */

.pharmacist-selector {
  width: 100%;
  height: 52px;
  padding: 0 var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-gray-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--color-gray-dark);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.pharmacist-selector:hover {
  border-color: var(--color-primary);
}

.pharmacist-selector__person {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.pharmacist-selector__avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--color-surface);
  box-shadow: 0 0 0 1px var(--color-gray-border);
}

.pharmacist-selector__name {
  font-weight: var(--fw-medium);
}

.pharmacist-selector__role {
  font-size: var(--fs-xs);
  color: var(--color-gray-light);
  margin-left: var(--space-2);
}

/* ==========================================================================
   ÉCRAN DE BIENVENUE — P13
   ========================================================================== */

.welcome-screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  background: var(--color-surface);
}

.welcome-screen__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6) var(--space-4);
}

.welcome-check {
  width: 112px;
  height: 112px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #4A90E2 0%, #1A5DA0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
  position: relative;
  box-shadow: 0 12px 32px rgba(74, 144, 226, 0.35);
  animation: welcome-check-in 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 100ms backwards;
}

.welcome-check::before,
.welcome-check::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-primary);
  opacity: 0.3;
  animation: welcome-check-ring 1.8s ease-out infinite;
}

.welcome-check::after {
  animation-delay: 900ms;
}

.welcome-check svg {
  color: white;
  animation: welcome-check-draw 500ms var(--ease-out) 400ms backwards;
}

@keyframes welcome-check-in {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes welcome-check-ring {
  0% {
    opacity: 0.35;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}

@keyframes welcome-check-draw {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.welcome-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.welcome-confetti span {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  opacity: 0;
  animation: welcome-confetti-fall 1.4s ease-out 300ms forwards;
}

.welcome-confetti span:nth-child(1) { left: 12%; top: 20%; background: #4A90E2; animation-delay: 300ms; }
.welcome-confetti span:nth-child(2) { left: 28%; top: 15%; background: #FFA801; animation-delay: 380ms; border-radius: 50%; }
.welcome-confetti span:nth-child(3) { left: 45%; top: 10%; background: #BB3A0A; animation-delay: 420ms; }
.welcome-confetti span:nth-child(4) { left: 62%; top: 18%; background: #4A90E2; animation-delay: 360ms; border-radius: 50%; }
.welcome-confetti span:nth-child(5) { left: 78%; top: 14%; background: #2D8A4E; animation-delay: 460ms; }
.welcome-confetti span:nth-child(6) { left: 88%; top: 22%; background: #1A5DA0; animation-delay: 340ms; border-radius: 50%; }
.welcome-confetti span:nth-child(7) { left: 22%; top: 30%; background: #FFA801; animation-delay: 500ms; }
.welcome-confetti span:nth-child(8) { left: 72%; top: 28%; background: #4A90E2; animation-delay: 440ms; border-radius: 50%; }

@keyframes welcome-confetti-fall {
  0% {
    opacity: 0;
    transform: translateY(-20px) rotate(0deg);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(200px) rotate(360deg);
  }
}

.welcome-screen__title {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold);
  color: var(--color-gray-dark);
  margin-bottom: var(--space-3);
  animation: welcome-fade-in 500ms var(--ease-out) 500ms backwards;
}

.welcome-screen__subtitle {
  font-size: var(--fs-sm);
  color: var(--color-gray);
  line-height: 1.5;
  margin-bottom: var(--space-8);
  max-width: 300px;
  animation: welcome-fade-in 500ms var(--ease-out) 650ms backwards;
}

.welcome-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  max-width: 320px;
  margin-bottom: var(--space-8);
}

.welcome-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  text-align: left;
  animation: welcome-step-in 500ms var(--ease-out) backwards;
}

.welcome-step:nth-child(1) { animation-delay: 800ms; }
.welcome-step:nth-child(2) { animation-delay: 920ms; }
.welcome-step:nth-child(3) { animation-delay: 1040ms; }

.welcome-step__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.welcome-step__text {
  font-size: var(--fs-sm);
  color: var(--color-gray-dark);
  line-height: 1.35;
  font-weight: var(--fw-medium);
}

.welcome-screen__footer {
  padding-top: var(--space-4);
  animation: welcome-fade-in 500ms var(--ease-out) 1200ms backwards;
}

@keyframes welcome-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes welcome-step-in {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
