/* =====================================================================
   AIBUTAI — auth.css (S2.1)
   Split layout: brand panel + form card. app.css ke tokens use hote hain.
   Rule: hardcoded colour sirf :root me.
   ===================================================================== */

:root {
  --auth-panel:      #0F172A;
  --auth-panel-2:    #1E293B;
  --auth-panel-ink:  #E2E8F0;
  --auth-panel-soft: #A8B6CA;
  --auth-panel-line: rgba(226, 232, 240, .16);
  --auth-panel-acc:  #A5B4FC;
  --auth-ok:         #4ADE80;
}

/* ---------- 1. page shell ---------- */
.auth-body {
  background: var(--bg);
  min-height: 100vh;
}

.auth-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- 2. brand panel ---------- */
.auth-brand {
  position: relative;
  padding: var(--s10) var(--s9);
  color: var(--auth-panel-ink);
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(79, 70, 229, .55), transparent 60%),
    linear-gradient(160deg, var(--auth-panel), var(--auth-panel-2));
  display: flex;
  flex-direction: column;
  gap: var(--s8);
}

.auth-brand .brand {
  color: var(--auth-panel-ink);
  font-weight: 700;
  letter-spacing: -.01em;
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  font-size: 18px;
}

.auth-brand .brand:hover { color: #fff; }

.auth-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: var(--auth-panel-acc);
  color: var(--auth-panel);
  font-weight: 800;
  font-size: 16px;
}

.auth-brand .brand-tag {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--auth-panel-soft);
}

.auth-tagline {
  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: -.02em;
}

.auth-tagline span { color: var(--auth-panel-acc); }

.auth-lead {
  margin: var(--s4) 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--auth-panel-soft);
  max-width: 44ch;
}

.auth-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s5);
  max-width: 46ch;
}

.auth-points li {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.55;
  color: var(--auth-panel-ink);
}

.auth-points li strong { display: block; font-weight: 600; }

.auth-points li small {
  display: block;
  font-size: 12.5px;
  color: var(--auth-panel-soft);
}

.auth-points .icon {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--auth-ok);
}

.auth-brand-foot {
  margin-top: auto;
  padding-top: var(--s6);
  border-top: 1px solid var(--auth-panel-line);
  display: flex;
  gap: var(--s5);
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--auth-panel-soft);
}

.auth-brand-foot a { color: var(--auth-panel-ink); }

/* ---------- 3. form side ---------- */
.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s5);
  padding: var(--s9) var(--s6);
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: var(--s8) var(--s7);
}

.auth-card.wide { max-width: 560px; }

.auth-head { margin-bottom: var(--s6); }

.auth-h1 {
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 var(--s2);
  letter-spacing: -.02em;
}

.auth-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-500);
}

.auth-form .field { margin-bottom: var(--s4); }

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
  margin: 0 0 var(--s5);
}

.auth-row .checkbox { margin: 0; }

.auth-row a { font-size: 13px; font-weight: 600; }

.auth-alt {
  margin: var(--s5) 0 0;
  font-size: 14px;
  text-align: center;
  color: var(--ink-500);
}

.auth-alt a { font-weight: 600; }

.auth-foot {
  font-size: 12px;
  color: var(--ink-500);
  text-align: center;
}

.auth-foot a { color: var(--ink-700); text-decoration: underline; text-underline-offset: 2px; }

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-500);
  margin-bottom: var(--s4);
}

.auth-back:hover { color: var(--ink-900); }

.auth-note {
  margin: var(--s4) 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-500);
}

/* dev-only helper blocks */
.auth-dev {
  margin-top: var(--s4);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--line-soft);
  padding: var(--s3) var(--s4);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-700);
  word-break: break-all;
}

.auth-dev b { color: var(--ink-900); }

.auth-dev code {
  font-family: var(--mono);
  font-size: 11.5px;
}


/* ---------- 4. password strength meter (S2.2) ---------- */
.pw-meter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 6px 0 4px;
}

.pw-bar {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--line);
  transition: background-color .18s ease;
}

.pw-meter[data-score="1"] .pw-bar:nth-child(1) { background: var(--danger); }
.pw-meter[data-score="2"] .pw-bar:nth-child(-n+2) { background: var(--warn); }
.pw-meter[data-score="3"] .pw-bar:nth-child(-n+3) { background: var(--info); }
.pw-meter[data-score="4"] .pw-bar { background: var(--success); }

.pw-label {
  font-size: 12px;
  color: var(--ink-500);
}

.pw-label.weak { color: var(--danger); }
.pw-label.ok { color: var(--success); }

/* ---------- 5. OTP boxes (S2.3) ---------- */
.otp-row {
  display: flex;
  gap: var(--s2);
  margin: var(--s2) 0 var(--s4);
}

.otp-box {
  width: 100%;
  height: 56px;
  min-width: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-900);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.otp-box:hover { border-color: var(--ink-400); }

.otp-box:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--brand-100);
}

.otp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-500);
  margin-bottom: var(--s5);
}

.otp-meta .link-btn {
  background: none;
  border: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-600);
}

.otp-meta .link-btn:disabled {
  color: var(--ink-500);
  cursor: not-allowed;
}

/* ---------- 6. onboarding steps (S2.5) ---------- */
.steps {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin: 0 0 var(--s6);
  list-style: none;
  padding: 0;
}

.step {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 12px;
  color: var(--ink-500);
  min-width: 0;
}

.step + .step::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--line);
  margin-right: var(--s1);
}

.step .dot {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--card);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-500);
}

.step.now { color: var(--ink-900); font-weight: 600; }

.step.now .dot {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}

.step.done .dot {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}

.step .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
  margin-top: var(--s5);
}

.form-actions .btn { min-width: 132px; }

/* ---------- 7. demo credentials (dev only) ---------- */
.auth-demo {
  margin-top: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.auth-demo summary {
  cursor: pointer;
  padding: var(--s3) var(--s4);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
  background: var(--line-soft);
  list-style: none;
}

.auth-demo summary::-webkit-details-marker { display: none; }

.auth-demo table { width: 100%; font-size: 12px; }

.auth-demo th,
.auth-demo td {
  text-align: left;
  padding: 6px var(--s4);
  border-top: 1px solid var(--line);
  white-space: nowrap;
}

.auth-demo th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-500);
  font-weight: 600;
}

.auth-demo code { font-family: var(--mono); font-size: 11.5px; }

/* ---------- 8. responsive ---------- */
@media (max-width: 960px) {
  .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-main { padding: var(--s7) var(--s4); min-height: 100vh; }
  .auth-card { padding: var(--s6) var(--s5); }
}

@media (max-width: 420px) {
  .auth-h1 { font-size: 22px; }
  .otp-box { height: 48px; font-size: 18px; }
  .step .lbl { display: none; }
  .step + .step::before { width: 18px; }
}

.auth-dev a { font-weight: 600; }
/* ---------- 9. polish v2 (P5) ---------- */
.auth-card {
  position: relative;
  overflow: hidden;
  --auth-ring: 0 0 0 4px rgba(79, 70, 229, .18);
  box-shadow:
    0 28px 64px -34px rgba(15, 23, 42, .38),
    0 2px 6px -3px rgba(15, 23, 42, .08);
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-600), #7C3AED 55%, #0EA5E9);
}
.auth-card.wide { max-width: 720px; }

/* wide (onboarding) card -> 2 columns */
.auth-card.wide .auth-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--s4);
}
.auth-card.wide .auth-form .field { margin-bottom: var(--s4); }
.auth-card.wide .auth-form .form-actions,
.auth-card.wide .auth-form .otp-row,
.auth-card.wide .auth-form .checkbox,
.auth-card.wide .auth-form textarea {
  grid-column: 1 / -1;
}
.auth-card.wide .auth-form .field:has(textarea) { grid-column: 1 / -1; }

/* focus ring */
.auth-form .input:focus-visible,
.auth-form .select:focus-visible,
.auth-form .textarea:focus-visible,
.auth-form .otp-box:focus-visible,
.auth-card button:focus-visible,
.auth-card a:focus-visible {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: var(--auth-ring, 0 0 0 4px rgba(79, 70, 229, .18));
}

/* brand panel: 3-stat mini row */
.auth-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s3);
  padding: var(--s4) 0;
  border-block: 1px solid var(--auth-panel-line);
}
.auth-stat-value {
  display: block;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.auth-stat-label {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--auth-panel-soft);
}

/* gradient password meter */
.pw-bar { transition: background-color .18s ease, background-image .18s ease; }
.pw-meter[data-score="3"] .pw-bar:nth-child(-n+3) {
  background-image: linear-gradient(90deg, #0EA5E9, #6366F1);
}
.pw-meter[data-score="4"] .pw-bar {
  background-image: linear-gradient(90deg, #10B981, #22D3EE);
}

/* OTP: bhara hua box */
.otp-box.filled {
  border-color: var(--brand-600);
  background: var(--brand-50);
  color: var(--brand-700);
}

/* demo credentials: chip look */
.auth-demo { border-radius: var(--r-md); background: var(--card); }
.auth-demo summary { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.auth-demo summary::before {
  content: "dev";
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--brand-100);
  color: var(--brand-700);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.auth-demo summary::after { content: "▾"; margin-left: auto; color: var(--ink-500); }
.auth-demo[open] summary::after { content: "▴"; }
.auth-demo td code { color: var(--ink-900); }

@media (max-width: 960px) {
  .auth-stats { display: none; }
}

@media (max-width: 640px) {
  .auth-card.wide .auth-form { grid-template-columns: 1fr; }
}

