:root {
  --ink: #0f1117;
  --paper: #f8f6f1;
  --cream: #eee9df;
  --accent: #d35233;
  --accent-light: #f0a68e;
  --accent-glow: rgba(211, 82, 51, 0.12);
  --teal: #1a7a6d;
  --teal-light: #a3d9cf;
  --slate: #4a4e5a;
  --muted: #8a8d96;
  --card-bg: #ffffff;
  --border: #e2ddd4;
  --radius: 14px;
  --shadow-sm:
    0 1px 3px rgba(15, 17, 23, 0.04), 0 1px 2px rgba(15, 17, 23, 0.06);
  --shadow-md:
    0 4px 16px rgba(15, 17, 23, 0.06), 0 2px 4px rgba(15, 17, 23, 0.04);
  --shadow-lg:
    0 12px 40px rgba(15, 17, 23, 0.08), 0 4px 12px rgba(15, 17, 23, 0.04);
  --danger: #dc2626;
  --success: #16a34a;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  font-family: "Outfit", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* === FULL PAGE CENTERED === */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}

/* Background blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.blob-1 {
  top: -200px;
  right: -150px;
  width: 600px;
  height: 600px;
  background: radial-gradient(
    ellipse at 40% 40%,
    var(--accent-glow) 0%,
    transparent 65%
  );
  animation: drift 10s ease-in-out infinite;
}

.blob-2 {
  bottom: -180px;
  left: -120px;
  width: 500px;
  height: 500px;
  background: radial-gradient(
    ellipse at 60% 60%,
    rgba(26, 122, 109, 0.06) 0%,
    transparent 65%
  );
  animation: drift 12s ease-in-out infinite reverse;
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-25px) scale(1.03);
  }
}

/* === CARD === */
.card {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  margin-bottom: 2.5rem;
  justify-content: center;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 15px;
  font-family: "JetBrains Mono", monospace;
}

.logo-text {
  font-family: "DM Serif Display", serif;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
}

/* Form card */
.form-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

.form-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
}

.form-card-body {
  padding: 2.5rem;
}

/* === ICON CIRCLE === */
.icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  transition: all 0.4s ease;
}

.icon-circle-orange {
  background: var(--accent-glow);
}

.icon-circle-green {
  background: rgba(22, 163, 74, 0.1);
}

.icon-circle-blue {
  background: rgba(37, 99, 235, 0.1);
}

/* === CODE 6 CHIFFRES === */
.code-inputs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.75rem 0 1.5rem;
}

.code-digit {
  width: 48px;
  height: 58px;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--dark);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  caret-color: transparent;
}

.code-digit:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(211, 82, 51, 0.12);
}

/* === HEADINGS === */
.form-title {
  font-family: "DM Serif Display", serif;
  font-size: 1.65rem;
  letter-spacing: -0.5px;
  text-align: center;
  margin-bottom: 0.4rem;
}

.form-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 300;
  text-align: center;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* === WARNING BANNER === */
.warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 10px;
  margin-bottom: 1.75rem;
}

.warning-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--warning-text);
  margin-top: 1px;
}

.warning-text {
  font-size: 0.82rem;
  color: var(--warning-text);
  line-height: 1.55;
  font-weight: 400;
}

.warning-text strong {
  font-weight: 600;
}

/* === FORM FIELDS === */
.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.2s;
}

.input-wrap input {
  width: 100%;
  padding: 13px 14px 13px 44px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: "Outfit", sans-serif;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--card-bg);
  outline: none;
  transition: all 0.25s ease;
}

.input-wrap input::placeholder {
  color: var(--muted);
  font-weight: 300;
}

.input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-wrap input:focus ~ .input-icon {
  color: var(--accent);
}

.field.error .input-wrap input {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.field-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 5px;
  display: none;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.field.error .field-error {
  display: flex;
}

/* === BUTTON === */
.btn-submit {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-family: "Outfit", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  margin-top: 0.5rem;
}

.btn-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent), #b83a1f);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-submit:hover::before {
  opacity: 1;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(15, 17, 23, 0.15);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-submit.loading span {
  opacity: 0;
}

.btn-submit.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(248, 246, 241, 0.3);
  border-top-color: var(--paper);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  z-index: 1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* === STEPS (request → success) === */
.step {
  display: none;
}
.step.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === SUCCESS STATE === */
.success-email {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  background: var(--cream);
  padding: 4px 12px;
  border-radius: 6px;
  color: var(--ink);
  font-weight: 500;
  margin: 0.25rem 0;
}

.success-checklist {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--slate);
  font-weight: 300;
  line-height: 1.5;
}

.check-dot {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.resend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.resend-row span {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 300;
}

.resend-btn {
  background: none;
  border: none;
  font-family: "Outfit", sans-serif;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.resend-btn:hover {
  color: var(--ink);
}

.resend-btn:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

/* === BACK LINK === */
.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 1.75rem;
  text-decoration: none;
  color: var(--slate);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent);
}

.back-link svg {
  transition: transform 0.2s;
}
.back-link:hover svg {
  transform: translateX(-3px);
}

/* === FOOTER === */
.page-footer {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 300;
  white-space: nowrap;
  z-index: 1;
}

.page-footer strong {
  font-weight: 600;
  color: var(--slate);
}

/* === RESPONSIVE === */
@media (max-width: 500px) {
  .page {
    padding: 1.5rem;
  }
  .form-card-body {
    padding: 1.75rem 1.5rem;
  }
  .form-title {
    font-size: 1.4rem;
  }
}
