/* ============================================
   AUTH MODALS - DESIGN MINIMALISTE APPLE/TESLA
   Style épuré, élégant et fonctionnel
   ============================================ */

/* ===== CSS VARIABLES ===== */
:root {
  --auth-bg: #fafafa;
  --auth-surface: #ffffff;
  --auth-text: #1d1d1f;
  --auth-text-secondary: #86868b;
  --auth-border: #d2d2d7;
  --auth-border-focus: #0071e3;
  --auth-accent: #0071e3;
  --auth-accent-hover: #0077ed;
  --auth-error: #ff3b30;
  --auth-success: #34c759;
  --auth-radius: 12px;
  --auth-radius-lg: 16px;
  --auth-transition: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ===== MODAL OVERLAY ===== */
.auth-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--auth-transition),
    visibility var(--auth-transition);
}

.auth-modal.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

/* ===== MODAL CONTENT ===== */

/* Scrollbar minimaliste */

/* ===== CLOSE BUTTON ===== */
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--auth-bg);
  border: none;
  border-radius: 50%;
  font-size: 16px;
  color: var(--auth-text-secondary);
  cursor: pointer;
  transition: all var(--auth-transition);
  z-index: 10;
}

.modal-close:hover {
  background: var(--auth-border);
  color: var(--auth-text);
}

.modal-close:active {
  transform: scale(0.95);
}

/* ===== HEADER ===== */

/* ===== FORM ===== */
.auth-form {
  padding: 0 32px 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-label {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--auth-text);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  font-size: 16px;
  color: var(--auth-text);
  background: var(--auth-bg);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  outline: none;
  transition: all var(--auth-transition);
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.form-control::placeholder {
  color: var(--auth-text-secondary);
  opacity: 0.6;
}

.form-control:hover {
  border-color: #b8b8bd;
}

.form-control:focus {
  background: var(--auth-surface);
  border-color: var(--auth-border-focus);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

/* État d'erreur */
.form-control.error {
  border-color: var(--auth-error);
}

.form-control.error:focus {
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.15);
}

.form-error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--auth-error);
}

/* ===== BUTTONS ===== */

/* Primary Button - Style Apple */

.btn-primary {
  background: var(--auth-accent);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--auth-accent-hover);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

/* Secondary Button */
.btn-secondary {
  background: var(--auth-bg);
  color: var(--auth-accent);
  border: 1px solid var(--auth-border);
}

.btn-secondary:hover:not(:disabled) {
  background: #f0f0f5;
}

/* Login Button (outline style) */

/* Full Width */

/* Large */

/* ===== FOOTER ===== */

/* ===== SPINNER ===== */

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

/* ===== PASSWORD TOGGLE ===== */

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px;
  background: none;
  border: none;
  color: var(--auth-text-secondary);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: color var(--auth-transition);
}

.password-toggle:hover {
  color: var(--auth-text);
}

/* ===== NOTIFICATIONS ===== */
.notification-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
  z-index: 200000;
  pointer-events: none;
}

.notification {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--auth-surface);
  border-radius: var(--auth-radius);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 8px 24px -4px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  pointer-events: all;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.notification-message {
  flex: 1;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--auth-text);
  line-height: 1.4;
}

/* ===== AUTH BUTTONS DANS NAVIGATION ===== */

/* ===== ACCOUNT BUTTON ===== */

/* ===== USER DROPDOWN ===== */

/* ===== COMPACT MODAL ===== */

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .auth-modal {
    padding: 16px;
    align-items: flex-end;
  }

  .auth-form {
    padding-left: 24px;
    padding-right: 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .notification-container {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}

/* ===== FORCE INTERACTIVITY ===== */
/* S'assurer que tous les éléments de la modal sont interactifs */
.auth-modal.active,
.auth-modal.active *,
.auth-modal.active .auth-form,
.auth-modal.active .form-group,
.auth-modal.active .form-control,
.auth-modal.active .modal-close {
  pointer-events: all !important;
}

/* S'assurer que les inputs sont focusables */
.auth-modal.active input,
.auth-modal.active button,
.auth-modal.active a {
  pointer-events: all !important;
}

/* ===== PASSWORD INPUT WRAPPER ===== */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper .form-control {
  flex: 1;
}

.btn-toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-text-secondary);
  transition: all var(--auth-transition);
  font-size: 0;
}

.btn-toggle-password:hover {
  color: var(--auth-text);
}

/* ===== RESET CONFIRMATION ===== */

@keyframes scaleIn {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
