/* ==========================================================================
   Tesla Dashboard - Page de Connexion & Déverrouillage (Dark Glassmorphism)
   ========================================================================== */

:root {
  --bg-primary: #07090e;
  --bg-surface: rgba(17, 24, 39, 0.75);
  --bg-surface-elevated: rgba(31, 41, 55, 0.7);
  --bg-input: rgba(15, 23, 42, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(56, 189, 248, 0.6);

  --accent-cyan: #38bdf8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.35);
  --accent-red: #e82127;
  --accent-rose: #f43f5e;

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 40px rgba(56, 189, 248, 0.08);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(at 10% 15%, rgba(56, 189, 248, 0.12) 0px, transparent 45%),
    radial-gradient(at 90% 85%, rgba(232, 33, 39, 0.10) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(168, 85, 247, 0.06) 0px, transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
}

.login-wrapper {
  position: relative;
  width: 100%;
  max-width: 440px;
}

.bg-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-card);
  animation: cardAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardAppear {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.brand-section {
  text-align: center;
  margin-bottom: 28px;
}

.tesla-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: rgba(232, 33, 39, 0.12);
  border: 1px solid rgba(232, 33, 39, 0.3);
  color: var(--accent-red);
  margin-bottom: 16px;
  box-shadow: 0 0 25px rgba(232, 33, 39, 0.25);
  animation: pulseGlow 3s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(232, 33, 39, 0.2);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 30px rgba(232, 33, 39, 0.4);
    transform: scale(1.03);
  }
}

.login-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Alertes */
.auth-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fecdd3;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  margin-bottom: 20px;
  animation: shake 0.35s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.setup-intro {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #bae6fd;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  line-height: 1.4;
  margin-bottom: 20px;
}

/* Formulaires */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.input-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input {
  width: 100%;
  padding: 14px 44px 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  outline: none;
  transition: var(--transition);
}

.auth-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}

.btn-toggle-visibility {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0.6;
  transition: var(--transition);
}

.btn-toggle-visibility:hover {
  opacity: 1;
}

.remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.remember-label input[type="checkbox"] {
  accent-color: var(--accent-cyan);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #e82127 0%, #b91c1c 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(232, 33, 39, 0.4);
  transition: var(--transition);
  margin-top: 6px;
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(232, 33, 39, 0.55);
}

.btn-submit:active {
  transform: translateY(1px);
}

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

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.login-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
}
