/* ==========================================================
   auth.css — shared shell for sign in / up / forgot / reset
   / verify / SSO / MFA. Built on top of virtscale.css tokens.
   Premium enterprise. Split layout, restrained motion.
   ========================================================== */

/* ----- Reset card-style stuff: this file assumes virtscale.css is loaded ----- */

/* ----- Shell ----- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 0.85fr) minmax(0, 1.15fr);
  background: var(--bg);
  position: relative;
}
@media (max-width: 920px) {
  .auth-shell { grid-template-columns: 1fr; min-height: 100vh; }
}

/* ----- Brand side (left) ----- */
.auth-brand {
  position: relative;
  background: var(--bg-deep);
  border-right: 1px solid var(--line);
  padding: 40px 56px 48px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
@media (max-width: 920px) {
  .auth-brand {
    border-right: 0; border-bottom: 1px solid var(--line);
    padding: 28px 32px 32px;
  }
}
@media (max-width: 600px) {
  .auth-brand { padding: 24px 24px 26px; }
}
.auth-brand::before {
  content: "";
  position: absolute;
  top: -240px; left: -160px;
  width: 700px; height: 700px;
  background:
    radial-gradient(closest-side, rgba(46,155,95,0.10), rgba(46,155,95,0.02) 55%, transparent 75%);
  filter: blur(30px);
  pointer-events: none;
}

.auth-brand .brand {
  display: inline-flex; align-items: center; gap: 11px;
  color: var(--fg);
  text-decoration: none;
  position: relative; z-index: 1;
  width: max-content;
}
.auth-brand .brand-mark { width: 24px; height: 24px; display: inline-block; color: var(--fg); }
.auth-brand .brand-mark svg { width: 100%; height: 100%; display: block; }
.auth-brand .brand-mark .frame { display: none; }
.auth-brand .brand-mark .fill { fill: currentColor; }
.auth-brand .brand-word {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--fg);
}

.auth-brand .quote {
  margin-top: auto;
  position: relative; z-index: 1;
  max-width: 36ch;
}
.auth-brand .quote h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin: 0 0 18px;
  text-wrap: balance;
}
.auth-brand .quote h2 .accent { color: var(--accent); }
.auth-brand .quote p {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-3);
  margin: 0;
  max-width: 42ch;
}

.auth-brand .trust-row {
  margin-top: 32px;
  display: flex; gap: 22px; flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--fg-4);
  letter-spacing: 0.04em;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  position: relative; z-index: 1;
}
.auth-brand .trust-row span { display: inline-flex; align-items: center; gap: 8px; }
.auth-brand .trust-row span::before {
  content: "";
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.7;
}
@media (max-width: 920px) {
  .auth-brand .quote { margin-top: 28px; }
  .auth-brand .trust-row { margin-top: 24px; }
}

/* ----- Form side (right) ----- */
.auth-stage {
  position: relative;
  display: flex; flex-direction: column;
  padding: 40px 56px;
}
@media (max-width: 920px) { .auth-stage { padding: 32px 32px 56px; } }
@media (max-width: 600px) { .auth-stage { padding: 28px 22px 48px; } }

.auth-top {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 18px;
  font-family: var(--body); font-size: 14px;
  color: var(--fg-3);
}
.auth-top a {
  color: var(--fg-2);
  transition: color 160ms ease;
}
.auth-top a:hover { color: var(--fg); }

.auth-card-wrap {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 0;
}
@media (max-width: 600px) { .auth-card-wrap { padding: 12px 0; } }

.auth-card {
  width: 100%;
  max-width: 460px;
}
.auth-card-head { margin-bottom: 32px; }
.auth-card-head h1 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 32px;
  letter-spacing: -0.028em;
  color: var(--fg);
  margin: 0 0 10px;
  line-height: 1.1;
}
.auth-card-head p {
  font-family: var(--body);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--fg-3);
  margin: 0;
  max-width: 48ch;
}
.auth-card-head p a {
  color: var(--accent);
  font-weight: 500;
}
.auth-card-head p a:hover { color: #36AC6B; }

/* ----- Form primitives ----- */
.auth-form { display: grid; gap: 18px; }

.field { display: grid; gap: 7px; }
.field-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px;
}
.field-row label,
.field > label {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-2);
  letter-spacing: -0.005em;
}
.field-row .hint {
  font-family: var(--body); font-size: 13px;
}
.field-row .hint a {
  color: var(--accent);
  font-weight: 500;
}
.field-row .hint a:hover { color: #36AC6B; }

.input-wrap {
  position: relative;
}
.input,
.input-wrap input {
  width: 100%;
  font: inherit;
  font-family: var(--body);
  font-size: 14.5px;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 11px 14px;
  line-height: 1.4;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.input::placeholder,
.input-wrap input::placeholder { color: var(--fg-4); }
.input:focus,
.input-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--elevated);
  box-shadow: 0 0 0 3px rgba(46,155,95,0.14);
}
.input:disabled,
.input-wrap input:disabled {
  color: var(--fg-3);
  background: rgba(255,255,255,0.02);
  cursor: not-allowed;
}
.input.--error,
.input-wrap.--error input {
  border-color: var(--rose);
}
.input.--error:focus,
.input-wrap.--error input:focus {
  box-shadow: 0 0 0 3px rgba(200,102,110,0.14);
}

.input-wrap .toggle {
  position: absolute;
  top: 50%; right: 8px;
  transform: translateY(-50%);
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-3);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}
.input-wrap .toggle:hover {
  color: var(--fg);
  background: rgba(255,255,255,0.04);
}
.input-wrap input[type="password"] + .toggle,
.input-wrap input[type="text"]    + .toggle {
  /* sit comfortably without overlapping the value */
}
.input-wrap input.has-toggle { padding-right: 64px; }

.help {
  font-family: var(--body);
  font-size: 12.5px;
  color: var(--fg-4);
  line-height: 1.5;
}
.help.--error { color: var(--rose); }

/* Checkbox */
.check {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer;
  font-family: var(--body); font-size: 13.5px;
  color: var(--fg-2);
  user-select: none;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1px solid var(--line-3);
  background: var(--surface);
  display: grid; place-items: center;
  transition: border-color 160ms ease, background 160ms ease;
  flex: none;
}
.check input:focus-visible + .box {
  box-shadow: 0 0 0 3px rgba(46,155,95,0.18);
}
.check input:checked + .box {
  background: var(--accent);
  border-color: var(--accent);
}
.check input:checked + .box::after {
  content: "";
  width: 8px; height: 5px;
  border-left: 1.5px solid #061008;
  border-bottom: 1.5px solid #061008;
  transform: rotate(-45deg) translate(0, -1px);
}

/* Buttons (extend virtscale.css .btn) */
.btn-block { width: 100%; justify-content: center; padding: 12px 18px; font-size: 15px; min-height: 44px; }
.btn[disabled],
.btn.--loading {
  pointer-events: none;
  opacity: 0.78;
}
.btn .spinner {
  width: 14px; height: 14px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 700ms linear infinite;
  display: none;
}
.btn.--loading .spinner { display: inline-block; }
.btn.--loading .arrow-i { display: none; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn .spinner { animation: none; border-top-color: currentColor; opacity: 0.5; }
}

/* Divider */
.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 6px 0 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--fg-4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

/* Provider buttons */
.providers {
  display: grid;
  gap: 10px;
}
.provider {
  display: grid;
  grid-template-columns: 22px 1fr 22px;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  color: var(--fg);
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease;
  text-decoration: none;
}
.provider:hover { background: rgba(255,255,255,0.025); border-color: var(--line-3); }
.provider .ico {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  flex: none;
}
.provider .arrow {
  width: 14px; height: 14px;
  position: relative;
  opacity: 0.5;
}
.provider .arrow::before {
  content: "";
  position: absolute; inset: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M3 8h10M9 4l4 4-4 4'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M3 8h10M9 4l4 4-4 4'/></svg>") center / contain no-repeat;
}
.provider:hover .arrow { opacity: 1; }

/* Alerts */
.alert {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-family: var(--body);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--fg-2);
  align-items: start;
}
.alert .ico {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  margin-top: 1px;
}
.alert strong { color: var(--fg); font-weight: 600; }
.alert.--error {
  border-color: rgba(200,102,110,0.4);
  background: rgba(200,102,110,0.06);
}
.alert.--error strong { color: var(--rose); }
.alert.--warning {
  border-color: rgba(201,150,85,0.4);
  background: rgba(201,150,85,0.06);
}
.alert.--success {
  border-color: rgba(46,155,95,0.4);
  background: rgba(46,155,95,0.06);
}
.alert.--success strong { color: var(--accent); }

/* Footer note under form */
.auth-foot {
  margin-top: 32px;
  font-family: var(--body); font-size: 13px;
  color: var(--fg-4);
  line-height: 1.55;
  text-align: center;
}
.auth-foot a { color: var(--fg-2); }
.auth-foot a:hover { color: var(--fg); }

/* Bottom of stage — small print row */
.auth-bottom {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap;
  padding-top: 28px;
  font-family: var(--body); font-size: 12.5px;
  color: var(--fg-4);
  border-top: 1px solid var(--line);
}
.auth-bottom .left { display: inline-flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.auth-bottom a:hover { color: var(--fg-2); }
.auth-bottom .sep { color: var(--fg-faint); }

/* ----- Code input (verify / MFA TOTP) ----- */
.code-input {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.code-input.--four { grid-template-columns: repeat(4, 1fr); }
.code-input input {
  width: 100%;
  text-align: center;
  font: inherit;
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 16px 0;
  line-height: 1;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.code-input input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--elevated);
  box-shadow: 0 0 0 3px rgba(46,155,95,0.14);
}
@media (max-width: 460px) {
  .code-input { gap: 6px; }
  .code-input input { font-size: 20px; padding: 14px 0; }
}

/* ----- Page redirect / success states ----- */
.stage-state {
  display: grid; gap: 22px;
}
.stage-state .badge {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-2);
  letter-spacing: 0.04em;
  width: max-content;
}
.stage-state .badge .pip {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.stage-state .badge.--success .pip {
  box-shadow: 0 0 0 3px rgba(46,155,95,0.18);
}
.stage-state .icon-circle {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(46,155,95,0.10);
  border: 1px solid rgba(46,155,95,0.30);
  display: grid; place-items: center;
}
.stage-state .icon-circle svg { color: var(--accent); }
.stage-state .icon-circle.--info {
  background: rgba(46,155,95,0.05);
  border-color: var(--line-2);
}
.stage-state .icon-circle.--info svg { color: var(--fg-2); }
.stage-state .icon-circle.--warn {
  background: rgba(201,150,85,0.08);
  border-color: rgba(201,150,85,0.30);
}
.stage-state .icon-circle.--warn svg { color: var(--amber, #C99655); }
.stage-state .icon-circle.--error {
  background: rgba(200,102,110,0.08);
  border-color: rgba(200,102,110,0.30);
}
.stage-state .icon-circle.--error svg { color: var(--rose); }

.stage-state h2 {
  font-family: var(--sans); font-weight: 500;
  font-size: 28px; letter-spacing: -0.025em;
  color: var(--fg);
  margin: 0;
  line-height: 1.1;
}
.stage-state p {
  font-family: var(--body);
  font-size: 15.5px; line-height: 1.6;
  color: var(--fg-3);
  margin: 0;
  max-width: 52ch;
}
.stage-state p strong { color: var(--fg); font-weight: 600; }
.stage-state .actions { display: inline-flex; gap: 12px; flex-wrap: wrap; }

/* ----- Device-card / session detail box ----- */
.detail-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px 18px;
  display: grid; gap: 12px;
}
.detail-card .row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  font-family: var(--body); font-size: 13.5px;
}
.detail-card .row .k {
  color: var(--fg-4);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 2px;
}
.detail-card .row .v { color: var(--fg); }
.detail-card .row .v .sub { display: block; color: var(--fg-3); font-size: 12.5px; margin-top: 2px; }

/* ----- State-toggle dev strip (small, bottom-fixed, visible only with #devstrip) ----- */
.dev-strip {
  display: none;
  position: fixed;
  left: 50%; bottom: 20px;
  transform: translateX(-50%);
  z-index: 50;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(10,14,19,0.92);
  backdrop-filter: blur(10px);
  font-family: var(--mono); font-size: 11.5px;
  color: var(--fg-3);
}
.dev-strip.is-shown { display: inline-flex; align-items: center; gap: 8px; }
.dev-strip span { color: var(--fg-4); }
.dev-strip a {
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--fg-2);
  transition: color 160ms ease, background 160ms ease;
}
.dev-strip a:hover { color: var(--fg); background: rgba(255,255,255,0.04); }
.dev-strip a.is-active { background: var(--accent); color: #061008; }

.is-hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
