/* Layout authentification (login, inscription…) */

:root {
  --auth-primary: #0d6efd;
  --auth-primary-dark: #0a58ca;
  --auth-primary-deep: #084298;
  --auth-surface: #ffffff;
  --auth-muted: #6c757d;
  --auth-border: #dee2e6;
  --auth-text: #212529;
  --auth-radius: 14px;
  --auth-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

.auth-body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f8fafc;
  color: var(--auth-text);
}

.auth-body .app-messages {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  width: min(420px, calc(100vw - 2rem));
  margin: 0;
}

.auth-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* Panneau branding */
.auth-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  background-color: var(--auth-primary-deep);
  color: #fff;
  overflow: hidden;
}

.auth-brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--auth-bg-image, none);
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  z-index: 0;
}

.auth-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg,
      rgba(13, 110, 253, 0.88) 0%,
      rgba(8, 66, 152, 0.9) 50%,
      rgba(5, 44, 101, 0.94) 100%),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
  pointer-events: none;
  z-index: 1;
}

.auth-brand-content {
  position: relative;
  z-index: 2;
  max-width: 420px;
  animation: authFadeUp 0.6s ease-out;
}

.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  margin-bottom: 1.5rem;
}

.auth-brand-logo img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.auth-brand-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.auth-brand-tagline {
  font-size: 1.05rem;
  line-height: 1.6;
  opacity: 0.92;
  margin: 0 0 2rem;
}

.auth-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.92rem;
  line-height: 1.45;
  opacity: 0.95;
}

.auth-features li i {
  flex-shrink: 0;
  width: 1.35rem;
  margin-top: 0.15rem;
  opacity: 0.85;
}

.auth-brand-footer {
  position: absolute;
  bottom: 1.5rem;
  left: 3rem;
  z-index: 2;
  font-size: 0.78rem;
  opacity: 0.65;
}

.auth-mobile-hero {
  display: none;
  width: 100%;
  height: 148px;
  border-radius: var(--auth-radius);
  background-image: var(--auth-bg-image, none);
  background-size: cover;
  background-position: center 35%;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--auth-shadow);
}

.auth-mobile-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      rgba(13, 110, 253, 0.25) 0%,
      rgba(5, 44, 101, 0.75) 100%);
}

.auth-mobile-hero-caption {
  position: absolute;
  bottom: 0.85rem;
  left: 1rem;
  right: 1rem;
  z-index: 1;
  font-size: 0.82rem;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

/* Panneau formulaire */
.auth-form-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #f8fafc;
}

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

.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.75rem;
}

.auth-mobile-brand img {
  width: 200px;
  height: 200px;
  object-fit: contain;
}

.auth-mobile-brand span {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--auth-text);
}

.auth-card {
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  padding: 2rem;
}

.auth-card-header {
  margin-bottom: 1.75rem;
}

.auth-card-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.auth-card-header p {
  font-size: 0.9rem;
  color: var(--auth-muted);
  margin: 0;
}

.auth-field {
  margin-bottom: 1.15rem;
}

.auth-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--auth-text);
  margin-bottom: 0.4rem;
}

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

.auth-input-wrap>i.field-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--auth-muted);
  font-size: 0.88rem;
  pointer-events: none;
  z-index: 1;
}

.auth-input-wrap input {
  width: 100%;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  padding: 0.65rem 2.75rem 0.65rem 2.5rem;
  font-size: 0.95rem;
  background: var(--auth-surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input-wrap input::placeholder {
  color: #adb5bd;
}

.auth-input-wrap input:focus {
  outline: none;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.auth-input-wrap input.is-invalid {
  border-color: #dc3545;
}

.auth-input-wrap input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

.auth-toggle-password {
  position: absolute;
  right: 0.5rem;
  border: none;
  background: transparent;
  color: var(--auth-muted);
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 1;
}

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

.auth-field-error {
  font-size: 0.8rem;
  color: #dc3545;
  margin-top: 0.35rem;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.auth-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.auth-field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--auth-muted);
}

.auth-avatar-upload {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--auth-border);
}

.auth-avatar-preview {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #adb5bd;
  font-size: 1.75rem;
}

.auth-avatar-preview.has-image {
  background: transparent;
}

.auth-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-avatar-actions {
  flex: 1;
  min-width: 0;
}

.auth-avatar-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--auth-primary);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.auth-avatar-label:hover {
  border-color: var(--auth-primary);
  background: rgba(13, 110, 253, 0.04);
}

.auth-avatar-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-form-error {
  background: rgba(220, 53, 69, 0.06);
  border: 1px solid rgba(220, 53, 69, 0.2);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1.15rem;
  font-size: 0.85rem;
  color: #842029;
}

.auth-form-error ul {
  margin: 0;
  padding-left: 1.1rem;
}

.auth-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--auth-primary);
  margin-top: 0.5rem;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  cursor: pointer;
}

.auth-submit:hover:not(:disabled) {
  background: var(--auth-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(13, 110, 253, 0.35);
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.auth-secure-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.15rem;
  font-size: 0.78rem;
  color: #adb5bd;
}

.auth-card-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--auth-muted);
}

.auth-card-footer a {
  color: var(--auth-primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-card-footer a:hover {
  text-decoration: underline;
}

.auth-version {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: #adb5bd;
}

@keyframes authFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 991px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-mobile-brand {
    display: flex;
  }

  .auth-mobile-hero {
    display: block;
  }

  .auth-form-panel {
    min-height: 100vh;
    padding: 1.5rem;
  }

  .auth-card {
    padding: 1.5rem;
  }
}

@media (max-width: 380px) {
  .auth-card {
    padding: 1.25rem;
  }

  .auth-field-row {
    grid-template-columns: 1fr;
  }
}