/* ===========================
   3DConfigurator – Login page
   =========================== */

/* Palette & variables */
:root {
  --bg: #e5edff;
  --bg-alt: #f9fafb;

  --card-bg: #ffffff;
  --card-border: rgba(148, 163, 184, 0.25);

  --text-main: #0f172a;   /* slate-900 */
  --text-muted: #6b7280;  /* slate-500 */

  --primary: #3b82f6;      /* blue-500 */
  --primary-hover: #2563eb;/* blue-600 */

  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #b91c1c;

  /* 🧮 Nested border radius rule:
     R_outer = R_inner + padding */
  --card-inner-radius: 16px;         /* rayon du contenu interne */
  --card-padding: 16px;              /* espace entre bord et contenu */
  --radius-card: calc(
    var(--card-inner-radius) + var(--card-padding)
  );                                 /* rayon externe calculé */

  --radius-pill: 999px;
}

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

/* Corps de la page de login */
body.login {
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, #bfdbfe 0, transparent 55%),
    radial-gradient(circle at bottom right, #e5e7eb 0, transparent 55%),
    linear-gradient(135deg, var(--bg), var(--bg-alt));
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Carte principale (outer) */
.card-login {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-card);     /* 👈 rayon externe calculé */
  border: 1px solid var(--card-border);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.7);
  padding: var(--card-padding);          /* 👈 padding qui sert au calcul */
  display: flex;
  flex-direction: column;
  gap: 20px;
  backdrop-filter: blur(10px);
}

/* Si tu veux appliquer la règle jusqu'au contenu,
   tu peux envelopper ton HTML par .card-login-inner : 
   <div class="card-login">
     <div class="card-login-inner"> ... </div>
   </div>
*/
.card-login-inner {
  border-radius: var(--card-inner-radius);  /* 👈 rayon interne */
  background: rgba(255, 255, 255, 0.98);
}

/* Titre */
.card-login h1 {
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--text-main);
}

/* (Optionnel) sous-titre – si tu veux en ajouter un */
.card-login .subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Formulaire */
.card-login form {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Bouton Google */
.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;

  width: 100%;
  padding: 0.8rem 1.2rem;

  border-radius: var(--radius-pill);
  border: none;

  background: var(--primary);
  color: #ffffff;

  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.01em;

  cursor: pointer;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.05s ease;
}

/* Icône dans une pastille blanche pour ne plus se confondre avec le bleu */
.btn-google img {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  padding: 3px;
  box-shadow:
    0 0 0 1px rgba(148, 163, 184, 0.25),
    0 1px 2px rgba(15, 23, 42, 0.18);
  flex-shrink: 0;
}

/* Hover / active */
.btn-google:hover {
  background: var(--primary-hover);
  box-shadow:
    0 14px 32px rgba(37, 99, 235, 0.55),
    0 0 0 1px rgba(15, 23, 42, 0.03);
  transform: translateY(-1px);
}

.btn-google:active {
  transform: translateY(0);
  box-shadow:
    0 8px 18px rgba(37, 99, 235, 0.45),
    0 0 0 1px rgba(15, 23, 42, 0.05);
}

/* Focus accessible */
.btn-google:focus-visible {
  outline: 2px solid #bfdbfe;
  outline-offset: 2px;
}

/* Message d'erreur */
.error {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  font-size: 0.9rem;
}

/* Petit texte centré en dessous (si nécessaire) */
.card-login .footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
}

/* Responsive */
@media (max-width: 480px) {
  body.login {
    padding: 16px;
  }

  .card-login {
    padding: 16px;
    border-radius: calc(
      var(--card-inner-radius) + var(--card-padding)
    ); /* garde la même logique */
  }

  .card-login h1 {
    font-size: 1.5rem;
  }
}
