/* ============ SPLIT LAYOUT ============ */
.auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100dvh;
  min-height: 540px;
}
@media (max-width: 767px) {
  .auth { grid-template-columns: 1fr; height: 100dvh; }
}

/* ---------- LEFT PANEL ---------- */
.left {
  position: relative;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  padding: 32px 40px 40px clamp(20px, 5vw, 64px);
}
@media (max-width: 767px) { .left { padding: 22px 24px 32px; } }

.left__brand {
  /* taille et typographie via .retocca-brand */
  align-self: flex-start;
}
.left__center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 0;
}
.formwrap {
  width: 100%;
  max-width: 400px;
  position: relative;
}
.left__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.left__nudge {
  font-size: 13px;
  color: var(--color-fg-muted);
  line-height: 1.55;
}
.left__nudge strong { color: var(--color-fg); font-weight: 500; }

/* ---------- FORM VIEWS ---------- */
.view { transition: opacity .2s ease, transform .2s ease; }
.view.is-hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  position: absolute;
  inset: 0;
}
.form-h {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.form-sub {
  margin-top: 10px;
  font-size: 15px;
  color: var(--color-fg-muted);
  max-width: 320px;
  line-height: 1.55;
}
form { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.field { position: relative; }
.input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-fg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--color-fg-muted); }
.input:focus {
  outline: none;
  border: 1.5px solid var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79,63,217,0.08);
}
.input.has-error { border-color: var(--color-danger); }
.input[type="password"] { padding-right: 44px; }

.pw-toggle {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--color-fg-muted);
  opacity: 0.8;
  transition: opacity .1s ease;
}
.pw-toggle:hover { opacity: 1; }
.pw-toggle svg { width: 16px; height: 16px; stroke-width: 1.6; }
.pw-icon { display: flex; align-items: center; }
.pw-icon[hidden] { display: none; }

.pw-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .2s ease, opacity .2s ease, margin .2s ease;
}
.auth.is-password .pw-section { max-height: 140px; opacity: 1; }
.pw-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-fg-muted);
  user-select: none;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  width: 16px; height: 16px;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, border-color .15s ease;
  flex-shrink: 0;
}
.check__box svg { width: 11px; height: 11px; stroke: #fff; stroke-width: 2.4; fill: none; }
.check__box path { stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .15s ease; }
.check input:checked + .check__box { background: var(--color-primary); border-color: var(--color-primary); }
.check input:checked + .check__box path { stroke-dashoffset: 0; }
.check input:focus-visible + .check__box { box-shadow: 0 0 0 3px rgba(79,63,217,0.12); }
.forgot {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-fg-muted);
  transition: color .15s ease;
}
.forgot:hover { color: var(--color-fg); }

.cta {
  height: 48px;
  width: 100%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 9px;
  transition: background .15s ease;
}
.cta:hover { background: var(--color-primary-hover); }
.cta:disabled { cursor: default; opacity: 0.9; }
.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.sep span { font-family: var(--font-mono); font-size: 12px; color: var(--color-fg-muted); }

.mode-toggle {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--color-fg-muted);
  transition: color .15s ease;
}
.mode-toggle:hover { color: var(--color-fg); }

.error-banner {
  border: 1px solid var(--color-danger);
  background: rgba(184,58,58,0.06);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--color-danger);
  line-height: 1.45;
  margin-bottom: 16px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-top: 0; padding-bottom: 0;
  border-width: 0;
  transition: max-height .2s ease, opacity .2s ease, padding .2s ease, border-width .2s ease, margin .2s ease;
}
.error-banner.show {
  max-height: 80px; opacity: 1;
  padding-top: 10px; padding-bottom: 10px;
  border-width: 1px;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.shake { animation: shake .3s ease; }

/* ---------- SENT VIEW ---------- */
.sent { text-align: center; }
.sent__icon { width: 40px; height: 40px; margin: 0 auto 18px; color: var(--color-primary); }
.sent__icon svg { width: 40px; height: 40px; stroke: var(--color-primary); stroke-width: 1.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sent h2 { font-family: var(--font-display); font-weight: 400; font-size: 24px; letter-spacing: -0.02em; }
.sent__body { margin: 12px auto 0; font-size: 15px; color: var(--color-fg-muted); max-width: 300px; line-height: 1.55; }
.sent__email { font-family: var(--font-mono); font-size: 13px; color: var(--color-primary); }
.sent__resend { margin-top: 24px; font-family: var(--font-mono); font-size: 13px; color: var(--color-fg-muted); min-height: 20px; }
.sent__resend a { color: var(--color-primary); }
.sent__resend .ok { color: var(--color-success); }
.sent__alt { display: inline-block; margin-top: 16px; font-size: 13px; color: var(--color-fg-muted); transition: color .15s ease; }
.sent__alt:hover { color: var(--color-fg); }

/* ---------- RIGHT PANEL ---------- */
.right {
  position: relative;
  background: #14131A;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 48px 210px;
}
@media (max-width: 767px) { .right { display: none; } }
.right__svg {
  position: absolute;
  right: -120px; top: 50%;
  transform: translateY(-50%);
  width: 620px; height: 620px;
  z-index: 0; pointer-events: none;
}
.right__label {
  position: absolute;
  top: 48px; left: 48px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(252,252,250,0.40);
  z-index: 2;
}
.right__content { position: relative; z-index: 2; max-width: 480px; }
.right__statement {
  font-family: var(--font-display);
  font-weight: 400;
  color: #FCFCFA;
  font-size: clamp(32px, 3.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.right__rule { width: 100%; height: 1px; background: rgba(252,252,250,0.15); margin: 24px 0; max-width: 480px; }
.right__para { font-size: 14px; color: rgba(252,252,250,0.60); max-width: 400px; line-height: 1.6; }

.chips {
  position: absolute;
  left: 48px; bottom: 48px;
  z-index: 2;
  width: calc(100% - 96px);
  max-width: 460px;
  height: 104px;
}
.chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 11px;
  background: rgba(252,252,250,0.06);
  border: 1px solid rgba(252,252,250,0.12);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(252,252,250,0.70);
  white-space: nowrap;
}
.chip--1 { left: 0; top: 70px; animation: float1 5s ease-in-out infinite; }
.chip--2 { left: 120px; top: 8px; animation: float2 6s ease-in-out infinite .6s; }
.chip--3 { left: 70px; top: 39px; animation: float3 4.6s ease-in-out infinite 1.1s; }
@keyframes float1 { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes float2 { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
@keyframes float3 { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .chip { animation: none !important; } .spinner { animation-duration: 1.4s; } }

/* ---------- SUCCESS FADE ---------- */
.flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 2000; transition: opacity .3s ease; }
.flash.on { opacity: 1; pointer-events: all; }
