/* ========================================================================
   Rokudan SaaS — Auth (login, register, choisir rôle)
   ======================================================================== */

.auth {
  background: var(--cream);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
}

.auth-aside {
  position: relative;
  background: var(--ink);
  color: var(--cream);
  padding: var(--sp-8);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.auth-aside::after {
  content: "";
  position: absolute;
  top: -200px;
  right: -120px;
  width: 520px; height: 520px;
  background: radial-gradient(circle, var(--violet) 0%, transparent 60%);
  opacity: 0.55;
  pointer-events: none;
}
.auth-aside::before {
  content: "";
  position: absolute;
  bottom: -160px;
  left: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255, 251, 236, 0.06) 0%, transparent 65%);
}
.auth-aside .brand,
.auth-aside .brand-mark span { color: var(--cream); }
.auth-aside .brand-mark {
  background: var(--cream);
  color: var(--ink);
}
.auth-aside .brand-mark::before {
  background: radial-gradient(circle at 30% 20%, var(--violet) 0%, transparent 60%);
  opacity: 0.5;
}

.auth-aside-quote {
  position: relative;
  z-index: 1;
}
.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 251, 236, 0.6);
  margin-bottom: var(--sp-5);
}
.auth-eyebrow::before {
  content: "";
  width: 24px; height: 1px;
  background: currentColor;
}
/* Les titres sont forcés en --ink par base.css : on rétablit
   explicitement le crème sur tout heading du panneau sombre. */
.auth-aside h1,
.auth-aside h2,
.auth-aside h3 { color: var(--cream); }

.auth-quote {
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: var(--sp-6);
  color: var(--cream);
}
.auth-quote em {
  color: #B095FF;
  font-style: italic;
  font-weight: 300;
}
.auth-quote-cite {
  font-size: var(--fs-sm);
  color: rgba(255, 251, 236, 0.6);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-7);
}
.auth-quote-cite strong {
  color: var(--cream);
  font-weight: 500;
}

.auth-aside-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-5);
  position: relative;
  z-index: 1;
  padding-top: var(--sp-6);
  border-top: 1px solid rgba(255, 251, 236, 0.12);
}
.auth-aside-stat-num {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--cream);
  margin-bottom: 4px;
}
.auth-aside-stat-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 251, 236, 0.55);
}

.auth-main {
  display: flex;
  flex-direction: column;
  padding: var(--sp-8) var(--sp-8) var(--sp-5);
  position: relative;
}
.auth-main-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--mute);
}
.auth-main-top a { color: var(--ink); font-weight: 500; }
.auth-main-top a:hover { color: var(--violet); }

.auth-card {
  margin: auto;
  width: 100%;
  max-width: 460px;
  padding: var(--sp-7) 0;
}
.auth-card h1 {
  font-size: 40px;
  letter-spacing: -0.035em;
  line-height: 1;
  margin-bottom: var(--sp-3);
}
.auth-card h1 em { color: var(--violet); font-style: italic; font-weight: 300; }
.auth-card .auth-sub {
  font-size: var(--fs-md);
  color: var(--mute);
  margin-bottom: var(--sp-7);
  line-height: 1.5;
}

/* Choix du rôle (sign up) */
.role-choice {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.role-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  text-decoration: none;
  color: inherit;
}
.role-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.role-card.violet:hover { border-color: var(--violet); }
.role-card.violet { background: linear-gradient(160deg, var(--violet-mist) 0%, var(--paper) 100%); }
.role-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--cream-2);
  display: grid;
  place-items: center;
  color: var(--ink);
}
.role-card.violet .role-card-icon { background: var(--violet); color: #fff; }
.role-card-icon svg { width: 20px; height: 20px; }
.role-card-body strong {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink);
  display: block;
  margin-bottom: 3px;
}
.role-card-body span {
  font-size: var(--fs-xs);
  color: var(--mute);
  line-height: 1.4;
}
.role-card-arrow {
  color: var(--mute-2);
  width: 16px; height: 16px;
  transition: transform var(--t-fast) var(--ease-out);
}
.role-card:hover .role-card-arrow {
  color: var(--violet);
  transform: translateX(4px);
}

/* Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
}
.field .hint {
  font-size: 11px;
  color: var(--mute);
  margin-top: 2px;
}
.field-error {
  font-size: 11px;
  color: var(--red);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
}
.checkbox input { display: none; }
.checkbox .box {
  width: 18px; height: 18px;
  border-radius: 4px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
  margin-top: 1px;
  display: grid;
  place-items: center;
  transition: all var(--t-fast) var(--ease-out);
}
.checkbox input:checked + .box {
  background: var(--ink);
  border-color: var(--ink);
}
.checkbox input:checked + .box::after {
  content: "";
  width: 10px; height: 6px;
  border: 2px solid #fff;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}
.checkbox a { color: var(--violet); font-weight: 500; }

.auth-submit {
  margin-top: var(--sp-3);
  height: 48px;
  width: 100%;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  transition: background var(--t-fast) var(--ease-out);
}
.auth-submit:hover { background: var(--ink-3); }
.auth-submit.violet { background: var(--violet); box-shadow: var(--shadow-violet); }
.auth-submit.violet:hover { background: var(--violet-2); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-5) 0;
  color: var(--mute);
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.sso-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.sso-btn {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}
.sso-btn:hover { border-color: var(--ink); }
.sso-btn svg { width: 16px; height: 16px; }

.auth-foot {
  margin-top: auto;
  padding-top: var(--sp-7);
  font-size: var(--fs-xs);
  color: var(--mute);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
}
.auth-foot a { color: var(--mute); }
.auth-foot a:hover { color: var(--ink); }

/* Steps (multi-page sign-up) */
.steps {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.step-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: var(--mute);
  background: var(--paper);
}
.step-dot.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.step-dot.done {
  background: var(--violet);
  color: #fff;
  border-color: var(--violet);
}
.step-line {
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}
.step-line.done { background: var(--violet); }

/* Inline password meter */
.pwd-meter {
  display: flex;
  gap: 3px;
  margin-top: 6px;
}
.pwd-meter > span {
  flex: 1;
  height: 3px;
  background: var(--cream-3);
  border-radius: 2px;
  transition: background var(--t-fast) var(--ease-out);
}
.pwd-meter[data-strength="1"] > span:nth-child(1) { background: var(--red); }
.pwd-meter[data-strength="2"] > span:nth-child(-n+2) { background: var(--orange); }
.pwd-meter[data-strength="3"] > span:nth-child(-n+3) { background: var(--amber); }
.pwd-meter[data-strength="4"] > span { background: var(--green); }

/* Responsive */
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { padding: var(--sp-6); min-height: 240px; }
  .auth-aside-stats { grid-template-columns: 1fr 1fr 1fr; }
  .auth-quote { font-size: 32px; }
}
@media (max-width: 560px) {
  .auth-main { padding: var(--sp-6); }
  .auth-card h1 { font-size: 32px; }
  .field-row { grid-template-columns: 1fr; }
  .sso-row { grid-template-columns: 1fr; }
}
