:root {
  color-scheme: light;
  --color-bg: #e6ebf5;
  --color-card: rgba(255, 255, 255, 0.85);
  --color-border: rgba(255, 255, 255, 0.65);
  --color-text: #121826;
  --color-muted: #5f6473;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-danger: #dc2626;
  --color-success: #059669;
  --shadow-lg: 0 30px 60px rgba(15, 23, 42, 0.25);
  --amazonie: #02b074;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(2, 176, 116, 0.08), transparent 40%),
    radial-gradient(circle at 60% 0%, rgba(37, 99, 235, 0.15), transparent 40%),
    var(--color-bg);
  color: var(--color-text);
  padding: 32px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('../images/accueil.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(6px) saturate(1.1);
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.auth-stage {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  min-height: 70vh;
  align-items: stretch;
}

.auth-shell {
  flex: 0 0 420px;
  display: flex;
  align-items: center;
}

.auth-card {
  width: 100%;
  background: var(--color-card);
  border-radius: 28px;
  padding: 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(12px);
}

.auth-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 45%);
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

.auth-header {
  text-align: left;
  margin-bottom: 32px;
}

.auth-header img {
  width: 168px;
  height: auto;
  object-fit: contain;
  margin-bottom: 24px;
}

.auth-header h1 {
  margin: 0 0 10px;
  font-size: 1.95rem;
}

.auth-header p {
  margin: 0;
  color: var(--color-muted);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
}

input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(18, 24, 38, 0.08);
  background: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  outline: none;
  border-color: rgba(2, 176, 116, 0.8);
  box-shadow: 0 0 0 4px rgba(2, 176, 116, 0.15);
}

button {
  border: none;
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--amazonie), #04c384);
  width: 100%;
  box-shadow: 0 18px 30px rgba(2, 176, 116, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 24px 32px rgba(2, 176, 116, 0.35);
}

.auth-feedback {
  border-radius: 12px;
  padding: 14px;
  font-size: 0.95rem;
  margin-top: 16px;
  display: none;
}

.auth-feedback.is-visible {
  display: block;
}

.auth-feedback.error {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: var(--color-danger);
}

.auth-feedback.success {
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.3);
  color: var(--color-success);
}

.is-hidden {
  display: none;
}

.auth-stack {
  display: block;
}

.auth-stack.is-hidden,
.is-hidden {
  display: none;
}

.auth-inline {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.auth-link {
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  width: auto;
  color: var(--amazonie);
  font-weight: 600;
  font-size: 0.95rem;
}

.auth-link:hover {
  text-decoration: underline;
}

.reset-header h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.reset-help {
  margin: 0 0 20px;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.code-input {
  text-align: center;
  letter-spacing: 0.4em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.auth-meta {
  text-align: center;
  margin-top: 24px;
  color: var(--color-muted);
}

.auth-meta a {
  color: var(--amazonie);
  text-decoration: none;
  font-weight: 600;
}

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

.auth-hero {
  flex: 1;
  border-radius: 32px;
  position: relative;
  overflow: hidden;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 48px;
}

.auth-hero::before {
  content: '';
  position: absolute;
  inset: -20px;
  background-image: url('../images/accueil.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(3px) saturate(1.05);
  transform: scale(1.03);
}

.auth-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 15, 40, 0.4), rgba(8, 15, 40, 0.7));
}

.auth-hero__content {
  position: relative;
  z-index: 1;
  max-width: 420px;
  color: #f7fafc;
  text-align: right;
}

.auth-hero__eyebrow {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.75);
}

.auth-hero__title {
  font-size: 2.4rem;
  margin: 0 0 12px;
  font-weight: 700;
}

.auth-hero__subtitle {
  margin: 0;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 1024px) {
  body {
    padding: 24px;
  }

  .auth-stage {
    flex-direction: column;
  }

  .auth-shell,
  .auth-hero {
    flex: unset;
  }

  .auth-hero {
    min-height: 360px;
    border-radius: 24px;
  }

  .auth-hero__content {
    text-align: left;
    max-width: 100%;
  }
}

@media (max-width: 540px) {
  body {
    padding: 16px;
  }

  .auth-card {
    padding: 28px 24px;
  }
}
