/* Auth-specific styles for finCRM login / register / recover */

:root {
  --auth-accent: var(--blue);
  --auth-accent-2: var(--indigo);
}

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

.auth-page.centered {
  grid-template-columns: 1fr;
  place-items: center;
  padding: 32px;
}

.auth-page.fullbleed {
  grid-template-columns: 1fr;
  background:
    radial-gradient(900px 600px at 12% 18%, rgba(0,122,255,0.22), transparent 60%),
    radial-gradient(800px 600px at 88% 82%, rgba(88,86,214,0.22), transparent 55%),
    var(--bg);
}

/* ===== Hero / brand panel ===== */
.auth-hero {
  position: relative;
  padding: 44px 56px;
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(255,255,255,0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 100%, rgba(255,255,255,0.10), transparent 60%),
    linear-gradient(135deg, var(--auth-accent) 0%, var(--auth-accent-2) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}

/* Decorative grid */
.auth-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(700px 500px at 30% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(700px 500px at 30% 40%, #000 30%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.auth-hero > * { position: relative; z-index: 1; }

.auth-brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; letter-spacing: -0.01em;
}
.auth-brand .mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  border: 0.5px solid rgba(255,255,255,0.30);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.auth-brand .name { font-size: 18px; }
.auth-brand .name b { font-weight: 800; }

.auth-hero-body {
  margin-top: auto;
  max-width: 480px;
  display: flex; flex-direction: column; gap: 18px;
}
.auth-hero-eyebrow {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  opacity: 0.78;
}
.auth-hero h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 800;
  text-wrap: balance;
}
.auth-hero h1 .underline {
  background: linear-gradient(180deg, transparent 70%, rgba(255,255,255,0.35) 70%);
  padding: 0 4px;
}
.auth-hero p.lead {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.5;
  opacity: 0.92;
  max-width: 460px;
}

/* Feature bullets */
.auth-feats { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.auth-feat {
  display: flex; align-items: center; gap: 12px;
  font-size: 13.5px; font-weight: 500;
}
.auth-feat .ic {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.16);
  border: 0.5px solid rgba(255,255,255,0.22);
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 28px;
}

/* Floating dashboard preview card */
.auth-preview {
  position: absolute;
  right: -64px; bottom: 64px;
  width: 380px;
  background: rgba(255,255,255,0.14);
  border: 0.5px solid rgba(255,255,255,0.30);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: 16px;
  padding: 16px;
  color: #fff;
  transform: rotate(-2.2deg);
  box-shadow: 0 30px 80px rgba(0,0,0,0.30);
  display: none;
}
.auth-preview .pv-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12px; opacity: 0.85; }
.auth-preview .pv-h .dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.55); }
.auth-preview .pv-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.auth-preview .pv-kpi {
  background: rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 10px 12px;
}
.auth-preview .pv-kpi .l { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.75; font-weight: 700; }
.auth-preview .pv-kpi .v { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.auth-preview .pv-row {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  font-size: 12px;
}
.auth-preview .pv-row .pip { width: 6px; height: 6px; border-radius: 50%; }
.auth-preview .pv-row .meta { margin-left: auto; opacity: 0.75; font-size: 11px; }

@media (min-width: 1280px) {
  .auth-preview { display: block; }
}

.auth-foot {
  margin-top: 28px;
  display: flex; align-items: center; gap: 18px;
  font-size: 12px;
  opacity: 0.78;
}
.auth-foot .sep { opacity: 0.5; }

/* ===== Form panel ===== */
.auth-form-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 56px;
  position: relative;
  overflow-y: auto;
}
.auth-page.centered .auth-form-wrap,
.auth-page.fullbleed .auth-form-wrap {
  padding: 0;
  width: 100%;
  max-width: 460px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  display: flex; flex-direction: column; gap: 20px;
}
.auth-page.centered .auth-card,
.auth-page.fullbleed .auth-card {
  background: var(--bg-elev);
  padding: 32px;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.10), 0 0 0 0.5px rgba(0,0,0,0.04);
  max-width: 460px;
}

/* Top corner controls */
.auth-corner {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--label-2);
}
.auth-corner a { color: var(--auth-accent); font-weight: 600; text-decoration: none; }
.auth-corner a:hover { text-decoration: underline; }

.auth-mini-brand {
  display: none;
  align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.auth-mini-brand .mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--auth-accent) 0%, var(--auth-accent-2) 100%);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
  box-shadow: 0 8px 24px rgba(0,122,255,0.30);
}
.auth-mini-brand .name { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.auth-page.centered .auth-mini-brand,
.auth-page.fullbleed .auth-mini-brand { display: flex; }

.auth-head h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.auth-head .auth-sub {
  margin-top: 6px;
  color: var(--label-3);
  font-size: 14px;
  line-height: 1.45;
}
.auth-head .auth-sub a { color: var(--auth-accent); font-weight: 600; text-decoration: none; }
.auth-head .auth-sub a:hover { text-decoration: underline; }

/* Social */
.auth-social { display: flex; flex-direction: column; gap: 8px; }
.auth-social-btn {
  height: 44px;
  border-radius: 11px;
  background: var(--bg-elev);
  border: 0.5px solid var(--border-strong);
  color: var(--label);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer;
  transition: background .12s, transform .08s;
}
.auth-social-btn:hover { background: var(--hover-tint); }
.auth-social-btn:active { transform: scale(0.99); }
.auth-social-btn svg { flex: 0 0 18px; }
.auth-social-btn.dark { background: #1c1c1e; color: #fff; border-color: #1c1c1e; }
.auth-social-btn.dark:hover { background: #2c2c2e; }
:root.dark .auth-social-btn { background: var(--bg-elev-2); border-color: var(--border-strong); }
:root.dark .auth-social-btn.dark { background: #fff; color: #000; border-color: #fff; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--label-3);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px;
  background: var(--separator);
}

/* Form */
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .field { margin-bottom: 0; }

.auth-field { position: relative; }
.auth-field .auth-input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  border-radius: 11px;
  border: 0.5px solid var(--border-strong);
  background: var(--bg-elev);
  font-size: 14.5px;
  color: var(--label);
  outline: 0;
  transition: border-color .12s, box-shadow .12s;
  box-sizing: border-box;
}
.auth-field.no-icon .auth-input { padding-left: 14px; }
.auth-field .auth-input:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.18);
}
.auth-field .auth-input::placeholder { color: var(--label-3); }
.auth-field .auth-input.err { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,59,48,0.14); }

.auth-field .ic {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--label-3);
  pointer-events: none;
  display: inline-flex;
}
.auth-field:focus-within .ic { color: var(--auth-accent); }

.auth-field .trail-btn {
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--label-3);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.auth-field .trail-btn:hover { background: var(--hover-tint); color: var(--label-2); }

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--label);
  margin-bottom: 6px;
}
.auth-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.auth-label-row .auth-label { margin-bottom: 0; }
.auth-label-row a {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--auth-accent);
  text-decoration: none;
}
.auth-label-row a:hover { text-decoration: underline; }

.field-err {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--red);
  margin-top: 6px;
}

/* Password strength */
.auth-strength { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.auth-strength-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.auth-strength-bars span {
  height: 4px; border-radius: 999px;
  background: var(--separator);
  transition: background .15s;
}
.auth-strength.s1 .auth-strength-bars span:nth-child(-n+1) { background: var(--red); }
.auth-strength.s2 .auth-strength-bars span:nth-child(-n+2) { background: var(--orange); }
.auth-strength.s3 .auth-strength-bars span:nth-child(-n+3) { background: var(--yellow); }
.auth-strength.s4 .auth-strength-bars span { background: var(--green); }
.auth-strength-label {
  font-size: 11.5px;
  color: var(--label-3);
  font-weight: 600;
  display: flex; justify-content: space-between;
}
.auth-strength-label .lvl { color: var(--label-2); }

/* Checkbox row */
.auth-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--label-2);
}
.auth-check {
  display: inline-flex; align-items: center; gap: 9px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--label-2);
}
.auth-check input { position: absolute; opacity: 0; pointer-events: none; }
.auth-check .box {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.4px solid var(--border-strong);
  background: var(--bg-elev);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  flex: 0 0 18px;
  transition: background .12s, border-color .12s;
}
.auth-check input:checked + .box {
  background: var(--auth-accent);
  border-color: var(--auth-accent);
}
.auth-check input:checked + .box::after {
  content: "";
  width: 10px; height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.auth-check a { color: var(--auth-accent); font-weight: 600; text-decoration: none; }
.auth-check a:hover { text-decoration: underline; }

.auth-row .lnk {
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-accent);
  text-decoration: none;
}
.auth-row .lnk:hover { text-decoration: underline; }

/* Primary submit */
.auth-submit {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--auth-accent) 0%, color-mix(in oklab, var(--auth-accent) 80%, black) 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,122,255,0.30), 0 0 0 0.5px rgba(0,0,0,0.05);
  transition: transform .08s, box-shadow .15s, filter .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  letter-spacing: -0.005em;
}
.auth-submit:hover { filter: brightness(1.05); }
.auth-submit:active { transform: scale(0.99); }
.auth-submit:disabled { opacity: 0.55; cursor: not-allowed; }

/* Tabs (login/register) — pill */
.auth-tabs {
  display: inline-flex;
  background: rgba(118,118,128,0.12);
  padding: 3px;
  border-radius: 11px;
  gap: 0;
  align-self: flex-start;
  margin-bottom: 4px;
}
.auth-tabs button {
  background: transparent;
  border: 0;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--label-2);
  border-radius: 8px;
  cursor: pointer;
}
.auth-tabs button.active {
  background: var(--bg-elev);
  color: var(--label);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 0 0 0.5px rgba(0,0,0,0.05);
}

/* Back link (recover) */
.auth-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--label-2);
  font-size: 13px;
  font-weight: 600;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  align-self: flex-start;
}
.auth-back:hover { color: var(--label); }
.auth-back svg { transform: rotate(180deg); }

/* Success state (recover sent) */
.auth-success {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
  padding: 8px 0;
}
.auth-success .ring {
  width: 64px; height: 64px;
  border-radius: 999px;
  background: rgba(52,199,89,0.14);
  color: var(--green);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(52,199,89,0.32);
}
.auth-success h3 {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.015em;
}
.auth-success p {
  margin: 0;
  color: var(--label-3);
  font-size: 14px;
  line-height: 1.5;
}
.auth-success p .em { color: var(--label); font-weight: 600; }

/* Trust strip */
.auth-trust {
  display: flex; align-items: center; gap: 12px;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg-elev-2);
  border-radius: 10px;
  border: 0.5px solid var(--border);
  font-size: 12px;
  color: var(--label-3);
}
.auth-trust .ic {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: rgba(52,199,89,0.14);
  color: var(--green);
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 26px;
}

/* Footer of form area */
.auth-form-foot {
  margin-top: 14px;
  font-size: 12px;
  color: var(--label-3);
  display: flex; gap: 12px; align-items: center; justify-content: center;
}
.auth-form-foot a { color: var(--label-2); text-decoration: none; }
.auth-form-foot a:hover { color: var(--label); text-decoration: underline; }

/* Responsive */
@media (max-width: 960px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-form-wrap { padding: 32px 24px; }
  .auth-mini-brand { display: flex; }
}
@media (max-width: 480px) {
  .auth-form-wrap { padding: 24px 18px; }
  .auth-head h2 { font-size: 24px; }
}

/* Animated view transition */
.auth-view {
  animation: authFade .25s ease-out;
}
@keyframes authFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Theme toggle button (corner) */
.auth-theme-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--bg-elev);
  border: 0.5px solid var(--border);
  color: var(--label-2);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.auth-theme-btn:hover { background: var(--hover-tint); }

/* Demo banner (login) */
.auth-demo {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(0,122,255,0.08) 0%, rgba(88,86,214,0.06) 100%);
  border: 0.5px solid rgba(0,122,255,0.25);
  border-radius: 12px;
}
.auth-demo-l { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.auth-demo-tag {
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
  padding: 4px 8px; border-radius: 6px;
  background: var(--auth-accent); color: #fff;
  flex: 0 0 auto;
}
.auth-demo-t { font-size: 13px; font-weight: 700; color: var(--label); line-height: 1.2; }
.auth-demo-s { font-size: 12px; color: var(--label-3); margin-top: 1px; }
.auth-demo-btn {
  height: 30px; padding: 0 12px;
  font-size: 12.5px; font-weight: 600;
  background: var(--bg-elev);
  border: 0.5px solid var(--border-strong);
  border-radius: 8px;
  color: var(--auth-accent);
  cursor: pointer;
  flex: 0 0 auto;
}
.auth-demo-btn:hover { background: var(--hover-tint); }
:root.dark .auth-demo {
  background: linear-gradient(180deg, rgba(10,132,255,0.12) 0%, rgba(94,92,230,0.10) 100%);
  border-color: rgba(10,132,255,0.35);
}
.otp-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-row input {
  height: 52px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: 11px;
  border: 0.5px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--label);
  outline: 0;
}
.otp-row input:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.18);
}
