* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --brand: #f97316;
  --brand-dark: #ea580c;
  --brand-light: #fff7ed;
  --text: #0f1419;
  --text-2: #536471;
  --text-3: #8b98a5;
  --border: #e5e7eb;
  --error: #dc2626;
  --error-bg: #fef2f2;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: #fff;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 420px; height: 420px;
  background: radial-gradient(circle, var(--brand), transparent 70%);
  top: -160px; left: -160px;
  animation: floatA 14s ease-in-out infinite;
}
body::after {
  width: 360px; height: 360px;
  background: radial-gradient(circle, #fbbf24, transparent 70%);
  bottom: -140px; right: -140px;
  animation: floatB 18s ease-in-out infinite;
}
@keyframes floatA {
  0%,100% { transform: translate(0,0); }
  50% { transform: translate(30px,40px); }
}
@keyframes floatB {
  0%,100% { transform: translate(0,0); }
  50% { transform: translate(-30px,-30px); }
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 24px;
  padding: 32px 28px 28px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.03), 0 12px 40px rgba(0,0,0,0.06);
  animation: cardIn .55s cubic-bezier(.22,1,.36,1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (min-width: 520px) {
  .auth-card { padding: 40px 36px 32px; }
}

.auth-logo {
  width: 130px;
  max-width: 60%;
  height: auto;
  display: block;
  margin: 0 auto 22px;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

h1 {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
  line-height: 1.25;
}
@media (min-width: 520px) { h1 { font-size: 24px; } }

.subtitle {
  font-size: 14px;
  color: var(--text-2);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.45;
}
.subtitle a { color: var(--brand); font-weight: 700; text-decoration: none; }
.subtitle a:hover { text-decoration: underline; }

/* ============ TYPE TOGGLE ============ */
.type-toggle {
  display: flex;
  background: #f4f4f7;
  border-radius: 100px;
  padding: 4px;
  margin-bottom: 22px;
}
.type-toggle button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-2);
  border-radius: 100px;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s, color .2s, transform .15s;
}
.type-toggle button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ============ FIELDS ============ */
.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

/* Champs avec icône à gauche (padding-left 42px) */
.input-wrap input,
.input-wrap select {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 42px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: 0;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.input-wrap input:focus,
.input-wrap select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(249,115,22,0.12);
}
.input-wrap input::placeholder { color: var(--text-3); }

/* Date input : sans padding-left car pas d'icône overlay */
.input-wrap input[type="date"] {
  padding-left: 42px;
  padding-right: 12px;
}

/* Select : chevron en background + espace pour icône à gauche */
.input-wrap select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23536471' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  padding-right: 42px;
}

/* ============ ICÔNES DANS LES CHAMPS ============ */
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-3);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
  z-index: 2;
}
.input-icon svg {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px;
  max-height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.input-wrap:focus-within .input-icon { color: var(--brand); }

/* ============ TOGGLE PASSWORD (ŒIL) ============ */
.toggle-password {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background .15s, color .15s;
  z-index: 3;
  padding: 0;
}
.toggle-password:hover {
  background: var(--brand-light);
  color: var(--brand);
}
.toggle-password:active { transform: translateY(-50%) scale(.92); }
.toggle-password svg {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px;
  max-height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.toggle-password .icon-eye-off { display: none; }
.toggle-password.active .icon-eye { display: none; }
.toggle-password.active .icon-eye-off { display: block; }

/* ============ FORCE DU MOT DE PASSE ============ */
.password-strength {
  margin-top: 8px;
  display: none;
}
.password-strength.visible { display: block; }
.password-strength-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.password-strength-fill {
  height: 100%;
  width: 0%;
  background: #dc2626;
  border-radius: 4px;
  transition: width .3s ease, background .3s ease;
}
.password-strength-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
}
.password-strength[data-level="1"] .password-strength-fill { width: 25%; background: #dc2626; }
.password-strength[data-level="2"] .password-strength-fill { width: 50%; background: #f59e0b; }
.password-strength[data-level="3"] .password-strength-fill { width: 75%; background: #eab308; }
.password-strength[data-level="4"] .password-strength-fill { width: 100%; background: #16a34a; }

/* ============ ROW 2 ============ */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 400px) { .row2 { grid-template-columns: 1fr; gap: 0; } }

/* ============ BUSINESS ============ */
.business-fields {
  display: none;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
  margin-top: 6px;
}
.business-fields.visible { display: block; }

/* ============ BOUTON SUBMIT ============ */
.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-size: 15.5px;
  font-weight: 800;
  border: 0;
  border-radius: 100px;
  padding: 15px;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 6px 18px rgba(249,115,22,0.32);
  position: relative;
  overflow: hidden;
  transition: transform .08s, box-shadow .2s, opacity .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}
.btn-submit::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left .6s ease;
}
.btn-submit:hover:not(:disabled)::before { left: 100%; }
.btn-submit:hover:not(:disabled) { box-shadow: 0 8px 22px rgba(249,115,22,0.42); }
.btn-submit:active:not(:disabled) { transform: scale(.98); }
.btn-submit:disabled { opacity: .65; cursor: not-allowed; box-shadow: none; }
.btn-submit.success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 6px 18px rgba(22,163,74,0.35);
}
.btn-submit .btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.btn-submit.loading .btn-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ SWITCH LINK ============ */
.switch-link {
  text-align: center;
  font-size: 13.5px;
  color: var(--text-2);
  margin-top: 20px;
}
.switch-link a { color: var(--brand); font-weight: 700; text-decoration: none; }
.switch-link a:hover { text-decoration: underline; }

/* ============ ERROR ============ */
.error-box {
  background: var(--error-bg);
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 500;
  padding: 11px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  display: none;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
  animation: shakeIn .4s cubic-bezier(.22,1,.36,1);
}
.error-box.visible { display: flex; }
.error-box::before { content: "⚠"; font-size: 14px; flex-shrink: 0; margin-top: 1px; }
@keyframes shakeIn {
  0% { opacity: 0; transform: translateX(0); }
  20% { opacity: 1; transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
  100% { transform: translateX(0); }
}

/* ============ LIENS ============ */
.forgot-link {
  display: block;
  text-align: right;
  font-size: 12.5px;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  margin-top: 6px;
}
.forgot-link:hover { text-decoration: underline; }

.info-text {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
  margin-top: 8px;
}
.info-text a { color: var(--brand); font-weight: 600; text-decoration: none; }
.info-text a:hover { text-decoration: underline; }

/* ============ MOBILE ============ */
@media (max-width: 480px) {
  body { padding: 16px 12px; }
  .auth-card { padding: 26px 20px 22px; border-radius: 20px; }
  .auth-logo { width: 110px; margin-bottom: 18px; }
  h1 { font-size: 20px; }
  .subtitle { font-size: 13px; margin-bottom: 20px; }
  .btn-submit { font-size: 15px; padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
