/* Crossdeck — auth (sign-in / start-free) */
:root {
  --ds-bg: #f7f3ec;
  --ds-bg-soft: #faf7f0;
  --ds-canvas: #fbfaf6;
  --ds-surface: #ffffff;
  --ds-surface-soft: #fafaf6;
  --ds-border: rgba(23, 19, 17, 0.09);
  --ds-border-strong: rgba(23, 19, 17, 0.16);
  --ds-divider: rgba(23, 19, 17, 0.06);
  --ds-text: #14110f;
  --ds-text-soft: #2a2421;
  --ds-muted: #6b6259;
  --ds-muted-soft: #948a7e;
  --ds-accent-red: #ff3431;
  --ds-accent: #ff6e45;
  --ds-accent-strong: #ee4f25;
  --ds-accent-warm: #ff8d4b;
  --ds-accent-soft: rgba(255, 110, 69, 0.1);
  --ds-success: #0e7a52;
  --ds-success-soft: rgba(14, 122, 82, 0.1);
  --ds-warning: #b06912;
  --ds-warning-soft: rgba(176, 105, 18, 0.1);
  --ds-danger: #b3382a;
  --ds-danger-soft: rgba(179, 56, 42, 0.08);
  --ds-shadow-sm: 0 1px 2px rgba(20, 17, 15, 0.04);
  --ds-shadow-md: 0 8px 28px rgba(20, 17, 15, 0.06);
  --ds-shadow-lg: 0 24px 64px rgba(20, 17, 15, 0.08);
  --ds-radius: 10px;
  --ds-radius-sm: 6px;
  --ds-radius-lg: 14px;
  --ds-radius-pill: 999px;
  --ds-mono: "SF Mono", "JetBrains Mono", "Menlo", ui-monospace, monospace;
  --ds-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --ds-display: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Helvetica Neue", Arial, sans-serif;
  --max-width: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ds-bg);
  color: var(--ds-text);
  font-family: var(--ds-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11", "tnum";
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input { font: inherit; }

::selection { background: rgba(255, 110, 69, 0.22); color: var(--ds-text); }

/* ============ HEADER ============ */
.auth-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 243, 236, 0.78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--ds-border);
}

.auth-header-inner {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
}

.auth-brand img {
  display: block;
  height: 22px;
  width: auto;
}

.auth-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  color: var(--ds-text-soft);
}

.auth-nav a {
  padding: 6px 12px;
  border-radius: var(--ds-radius-sm);
  font-weight: 500;
  color: var(--ds-text-soft);
  position: relative;
  transition: color 120ms, background 120ms;
}

.auth-nav a:hover {
  color: var(--ds-text);
  background: rgba(23, 19, 17, 0.04);
}

.auth-nav a:not(.btn):not(.auth-nav-cta)::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 1.5px;
  background: var(--ds-accent-strong);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.auth-nav a:not(.btn):not(.auth-nav-cta):hover::after {
  transform: scaleX(1);
}

.auth-nav-cta {
  margin-left: 6px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--ds-radius-sm);
  border: 1px solid var(--ds-border);
  background: var(--ds-surface);
  color: var(--ds-text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 140ms, background 140ms, transform 140ms,
    box-shadow 140ms;
}

.btn:hover {
  border-color: var(--ds-border-strong);
  transform: translateY(-1px);
  box-shadow: var(--ds-shadow-sm);
}

.btn-accent {
  background: linear-gradient(180deg, var(--ds-accent) 0%, var(--ds-accent-strong) 100%);
  color: #fff;
  border-color: var(--ds-accent-strong);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 4px 12px rgba(238, 79, 37, 0.22);
}

.btn-accent:hover {
  filter: brightness(1.04);
}

/* ============ LAYOUT ============ */
.auth-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.auth-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 64px;
  gap: 48px;
  align-items: stretch;
}

/* ============ BRAND PANE ============ */
.auth-pane-brand {
  position: relative;
  border-radius: 16px;
  background: var(--ds-text);
  color: rgba(255, 255, 255, 0.92);
  padding: 36px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 580px;
}

.auth-pane-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(255, 52, 49, 0.18), transparent 70%),
    radial-gradient(ellipse 70% 50% at 90% 100%, rgba(255, 141, 75, 0.18), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.auth-pane-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 30%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.brand-pane-aurora {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.7;
}

.brand-pane-aurora.a {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 110, 69, 0.4), transparent 70%);
  top: -40px;
  right: -60px;
  animation: brandDrift1 14s ease-in-out infinite;
}

.brand-pane-aurora.b {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 52, 49, 0.32), transparent 70%);
  bottom: 40px;
  left: -40px;
  animation: brandDrift2 18s ease-in-out infinite;
}

@keyframes brandDrift1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, 24px); }
}

@keyframes brandDrift2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, -20px); }
}

.brand-pane-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100%;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-mark .wordmark {
  font-family: var(--ds-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #fff;
}

.brand-mark .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.brand-mark .chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ds-accent-warm);
  box-shadow: 0 0 0 3px rgba(255, 141, 75, 0.18);
}

.brand-pane-headline {
  font-family: var(--ds-display);
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 600;
  color: #fff;
  margin: 0;
  max-width: 14ch;
}

.brand-pane-headline .accent {
  background: linear-gradient(96deg, var(--ds-accent-red), var(--ds-accent-warm));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-pane-sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.65);
  max-width: 44ch;
}

/* Mini live signal preview inside brand pane */
.brand-signals {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand-signals-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-signals-head .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #57c4a0;
  box-shadow: 0 0 0 0 rgba(87, 196, 160, 0.6);
  animation: brandPulse 1.8s ease-out infinite;
}

@keyframes brandPulse {
  0% { box-shadow: 0 0 0 0 rgba(87, 196, 160, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(87, 196, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(87, 196, 160, 0); }
}

.brand-signal {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.brand-signal .ic {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #fff;
}

.brand-signal .ic.s { background: rgba(87, 196, 160, 0.22); color: #57c4a0; }
.brand-signal .ic.i { background: rgba(105, 158, 255, 0.22); color: #8eb6ff; }
.brand-signal .ic.w { background: rgba(255, 178, 96, 0.22); color: #ffb260; }

.brand-signal .meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-signal .title {
  font-size: 12.5px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-signal .sub {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--ds-mono);
}

.brand-signal .time {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.4);
  font-variant-numeric: tabular-nums;
}

/* ============ FORM PANE ============ */
.auth-pane-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: 14px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: var(--ds-shadow-md);
}

.auth-card-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-accent-strong);
}

.auth-eyebrow .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ds-accent-strong);
}

.auth-card h2 {
  margin: 0;
  font-family: var(--ds-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ds-text);
  line-height: 1.15;
}

.auth-card-sub {
  margin: 0;
  color: var(--ds-muted);
  font-size: 14px;
}

/* Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field span {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ds-text-soft);
  letter-spacing: -0.005em;
}

.auth-field input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-surface);
  color: var(--ds-text);
  font-size: 14px;
  font-feature-settings: "tnum";
  transition: border-color 140ms, box-shadow 140ms;
}

.auth-field input::placeholder {
  color: var(--ds-muted-soft);
}

.auth-field input:hover {
  border-color: var(--ds-border-strong);
}

.auth-field input:focus {
  outline: 0;
  border-color: var(--ds-accent-strong);
  box-shadow: 0 0 0 3px rgba(238, 79, 37, 0.16);
}

.auth-submit {
  height: 42px;
  padding: 0 16px;
  background: linear-gradient(180deg, var(--ds-text) 0%, #000 100%);
  color: #fff;
  border: 1px solid #000;
  border-radius: var(--ds-radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  transition: transform 140ms, box-shadow 140ms, opacity 140ms;
  position: relative;
  overflow: hidden;
}

.auth-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  transition: transform 700ms ease-out;
}

.auth-submit:hover::before {
  transform: translateX(100%);
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(20, 17, 15, 0.18);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ds-muted-soft);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ds-divider);
}

/* Provider buttons — single column with icon + label */
.auth-providers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-provider {
  height: 42px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-surface);
  color: var(--ds-text);
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 140ms, background 140ms, transform 140ms,
    box-shadow 140ms;
}

.auth-provider:hover {
  border-color: var(--ds-border-strong);
  transform: translateY(-1px);
  box-shadow: var(--ds-shadow-sm);
}

.auth-provider:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.auth-provider-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
}

.auth-provider-icon svg {
  width: 100%;
  height: 100%;
}

/* Status */
.auth-status {
  display: none;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--ds-radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
}

.auth-status.is-visible {
  display: block;
}

.auth-status[data-state="loading"] {
  background: var(--ds-canvas);
  border-color: var(--ds-border);
  color: var(--ds-text-soft);
}

.auth-status[data-state="success"] {
  background: var(--ds-success-soft);
  border-color: rgba(14, 122, 82, 0.18);
  color: var(--ds-success);
}

.auth-status[data-state="error"] {
  background: var(--ds-danger-soft);
  border-color: rgba(179, 56, 42, 0.18);
  color: var(--ds-danger);
}

/* Footer note */
.auth-note {
  margin: 0;
  font-size: 13px;
  color: var(--ds-muted);
  text-align: center;
}

.auth-note a {
  color: var(--ds-text);
  font-weight: 500;
}

.auth-note a:hover {
  color: var(--ds-accent-strong);
}

.auth-fineprint {
  margin: 0;
  font-size: 11.5px;
  color: var(--ds-muted-soft);
  text-align: center;
  line-height: 1.55;
}

.auth-fineprint a {
  color: var(--ds-muted);
  text-decoration: underline;
  text-decoration-color: rgba(107, 98, 89, 0.32);
  text-underline-offset: 2px;
}

.auth-fineprint a:hover {
  color: var(--ds-text);
  text-decoration-color: var(--ds-text);
}

/* ============ DASHBOARD STYLES (used by dashboard.css overrides only) ============ */
/* All other dashboard chrome is defined in dashboard/dashboard.css. */

/* ============ RESPONSIVE ============ */
@media (max-width: 920px) {
  .auth-stage {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 16px 48px;
  }

  .auth-pane-brand {
    min-height: 320px;
    padding: 28px;
  }

  .brand-pane-headline {
    font-size: clamp(24px, 6vw, 32px);
  }

  .brand-signals .brand-signal:nth-child(n + 4) {
    display: none;
  }

  .auth-card {
    padding: 28px 22px;
  }
}

@media (max-width: 640px) {
  .auth-nav a:not(.btn):not(.auth-nav-cta) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-pane-aurora,
  .brand-signals-head .live-dot,
  .auth-submit::before {
    animation: none;
  }
}
