/* HerbaGraph auth | Observatory brand panel + Laboratory form */

@font-face {
  font-family: "Geist";
  src: url("https://cdn.jsdelivr.net/npm/geist@1.3.1/dist/fonts/geist-sans/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --auth-lab-bg: #f7f8f5;
  --auth-surface: #ffffff;
  --auth-ink: #181b19;
  --auth-muted: #687069;
  --auth-border: #d9ddd8;
  --auth-input-border: #d7dcd6;
  --auth-green: #28784e;
  --auth-green-hover: #1f6843;
  --auth-green-soft: rgba(47, 125, 85, 0.045);
  --auth-green-ring: rgba(47, 125, 85, 0.1);
  --auth-obs-bg: #101311;
  --auth-obs-text: #f2f4ef;
  --auth-obs-muted: #a1a8a2;
  --auth-intel: #7381e2;
  --auth-bio: #62a27c;
  --auth-line: rgba(255, 255, 255, 0.1);
  --auth-font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --auth-mono: "IBM Plex Mono", ui-monospace, monospace;
}

.auth-page-v2 {
  margin: 0;
  min-height: 100vh;
  font-family: var(--auth-font);
  color: var(--auth-ink);
  background: var(--auth-lab-bg);
  display: grid;
  grid-template-columns: 44fr 56fr;
  -webkit-font-smoothing: antialiased;
}

.auth-page-v2 * { box-sizing: border-box; }

/* Brand panel */
.auth-brand-panel {
  position: relative;
  background: var(--auth-obs-bg);
  color: var(--auth-obs-text);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

.auth-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 70% 30%, rgba(115, 129, 226, 0.1), transparent 35%);
  pointer-events: none;
}

.auth-brand-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.auth-brand-panel .logo {
  color: var(--auth-obs-text);
  text-decoration: none;
}

.auth-brand-panel .logo:hover { color: var(--auth-obs-text); text-decoration: none; }

.auth-brand-message {
  margin-top: clamp(3rem, 14vh, 6rem);
  max-width: 28ch;
}

.auth-brand-message h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 620;
}

.auth-brand-message p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--auth-obs-muted);
  max-width: 38ch;
}

.auth-reasoning-graph {
  margin-top: 2.5rem;
  max-width: 320px;
  opacity: 0.95;
}

.auth-reasoning-graph svg {
  width: 100%;
  height: auto;
  display: block;
}

.auth-trust-list {
  margin-top: auto;
  padding-top: 2.5rem;
  list-style: none;
  margin-bottom: 0;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.auth-trust-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--auth-obs-muted);
}

.auth-trust-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--auth-bio);
  margin-top: 0.42rem;
  flex-shrink: 0;
}

.auth-brand-footnote {
  position: relative;
  z-index: 1;
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--auth-obs-muted);
  opacity: 0.85;
}

/* Form panel */
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 3rem);
  min-height: 100vh;
}

.auth-form-shell {
  width: 100%;
  max-width: 460px;
  margin-top: -2vh;
}

.auth-mobile-brand {
  display: none;
  margin-bottom: 1.5rem;
}

.auth-mobile-brand .logo { color: var(--auth-ink); text-decoration: none; }

.auth-mobile-lede {
  margin: 0.65rem 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--auth-muted);
  max-width: 36ch;
}

.auth-form-header h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.85rem, 4vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 620;
}

.auth-form-header .auth-lede {
  margin: 0 0 1.75rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--auth-muted);
}

.auth-form-header .auth-switch {
  margin: 0 0 1.75rem;
  font-size: 0.92rem;
  color: var(--auth-muted);
}

.auth-form-header .auth-switch a {
  color: var(--auth-green);
  font-weight: 600;
  text-decoration: none;
}

.auth-form-header .auth-switch a:hover { text-decoration: underline; }

.auth-form-surface {
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  padding: 1.5rem 1.4rem 1.35rem;
  box-shadow: 0 8px 28px rgba(17, 20, 18, 0.04);
}

.auth-field {
  margin-bottom: 1.1rem;
}

.auth-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.81rem;
  font-weight: 550;
  color: #353a36;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
  width: 100%;
  height: 48px;
  border-radius: 9px;
  border: 1px solid var(--auth-input-border);
  background: #ffffff;
  padding: 0 14px;
  font: inherit;
  font-size: 0.94rem;
  color: var(--auth-ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input::placeholder { color: #989e99; }

.auth-field input:focus {
  outline: none;
  border-color: var(--auth-green);
  box-shadow: 0 0 0 3px var(--auth-green-ring);
}

.auth-field.is-invalid input {
  border-color: #c44;
}

.auth-field-error {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: #b42318;
  line-height: 1.4;
}

.auth-field-error a {
  color: var(--auth-green);
  font-weight: 600;
  text-decoration: none;
}

.auth-field-error a:hover { text-decoration: underline; }

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap input {
  padding-right: 3.25rem;
}

.auth-password-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--auth-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  border-radius: 6px;
}

.auth-password-toggle:hover { color: var(--auth-ink); background: rgba(20, 24, 21, 0.04); }

.auth-password-rules {
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  color: var(--auth-muted);
  display: grid;
  gap: 0.25rem;
}

.auth-password-rules li::before {
  content: "○ ";
  color: #989e99;
}

.auth-password-rules li.is-met {
  color: var(--auth-green);
}

.auth-password-rules li.is-met::before {
  content: "✓ ";
}

.auth-account-type {
  margin-bottom: 1.25rem;
}

.auth-account-type legend {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--auth-ink);
  margin-bottom: 0.65rem;
  padding: 0;
}

.auth-type-options {
  display: grid;
  gap: 0.55rem;
}

.auth-type-option {
  position: relative;
}

.auth-type-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.auth-type-option label {
  display: block;
  padding: 0.8rem 0.9rem 0.8rem 2.35rem;
  border: 1px solid var(--auth-input-border);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.auth-type-option label::before {
  content: "";
  position: absolute;
  left: 0.95rem;
  top: 1.05rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #b8beb9;
  background: #fff;
}

.auth-type-option input:checked + label {
  border-color: #2f7d55;
  background: var(--auth-green-soft);
}

.auth-type-option input:checked + label::before {
  border-color: #2f7d55;
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px #2f7d55;
}

.auth-type-option input:focus-visible + label {
  outline: 2px solid var(--auth-green);
  outline-offset: 2px;
}

.auth-type-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--auth-ink);
  margin-bottom: 0.15rem;
}

.auth-type-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--auth-muted);
  line-height: 1.4;
}

.auth-submit {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 9px;
  background: var(--auth-green);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.15s ease, transform 0.15s ease;
}

.auth-submit:hover:not(:disabled) {
  background: var(--auth-green-hover);
  transform: translateY(-1px);
}

.auth-submit:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

.auth-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
}

@keyframes authSpin { to { transform: rotate(360deg); } }

.auth-banner-error,
.auth-banner-success {
  margin-bottom: 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: 9px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.auth-banner-error {
  background: #fff5f5;
  border: 1px solid #f5c2c0;
  color: #8f1f1a;
}

.auth-banner-success {
  background: #f4fbf7;
  border: 1px solid #c8e6d4;
  color: #1a4d32;
}

.auth-legal {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--auth-muted);
}

.auth-legal a {
  color: #4a5f52;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-privacy-note {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--auth-border);
}

.auth-privacy-note strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--auth-ink);
  margin-bottom: 0.2rem;
}

.auth-privacy-note p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--auth-muted);
}

.auth-form-links {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.88rem;
}

.auth-form-links a {
  color: var(--auth-green);
  font-weight: 500;
  text-decoration: none;
}

.auth-form-links a:hover { text-decoration: underline; }

.auth-guest-btn {
  width: 100%;
  margin-top: 0.55rem;
  height: 44px;
  border-radius: 9px;
  border: 1px solid var(--auth-border);
  background: transparent;
  color: var(--auth-muted);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.auth-guest-btn:hover { color: var(--auth-ink); border-color: #c5cac4; }

.auth-oauth-block {
  margin-bottom: 1.25rem;
}

.auth-google-btn {
  width: 100%;
  height: 48px;
  border-radius: 9px;
  border: 1px solid var(--auth-input-border);
  background: #fff;
  color: var(--auth-ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.auth-google-btn:hover:not(:disabled) {
  border-color: #c5cac4;
  background: #fafaf8;
  transform: translateY(-1px);
}

.auth-google-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-google-mark {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.15rem 0 1.25rem;
  font-size: 0.78rem;
  color: var(--auth-muted);
  text-transform: lowercase;
}

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

.auth-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(16, 19, 17, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-success-overlay[hidden] { display: none; }

.auth-success-card {
  width: min(100%, 380px);
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  padding: 1.5rem 1.35rem;
  box-shadow: 0 20px 50px rgba(12, 15, 13, 0.18);
}

.auth-success-card h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.auth-success-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--auth-muted);
}

.auth-success-steps li.is-done { color: var(--auth-green); font-weight: 500; }

.auth-mobile-graph {
  display: none;
  margin-top: 2rem;
  opacity: 0.55;
  max-width: 260px;
}

@media (max-width: 900px) {
  .auth-page-v2 { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .auth-mobile-brand { display: block; }
  .auth-form-panel { min-height: auto; align-items: flex-start; padding-top: 2rem; }
  .auth-form-shell { margin-top: 0; max-width: 100%; }
  .auth-mobile-graph { display: block; margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-spinner { animation: none; }
  .auth-submit:hover:not(:disabled) { transform: none; }
  .auth-reasoning-graph .auth-graph-line-active { animation: none; }
}

/* Subtle path pulse on brand graph */
.auth-graph-line-active {
  stroke-dasharray: 6 10;
  animation: authPathFlow 14s linear infinite;
}

@keyframes authPathFlow {
  to { stroke-dashoffset: -160; }
}