/* ── Strata brand tokens (site-revamp-phase1 source of truth) ── */
:root {
  --rust:        #BC3908;
  --rust-deep:   #9C2A04;
  --rust-mid:    #AF3306;
  --orange:      #E0641F;
  --peach:       #FFC26E;
  --cream:       #FFF6EA;
  --cream-muted: #F7E8D6;
  --ink:         #1C2B45;
  --ink-soft:    #243450;
  --ink-muted:   #4A5E7A;  /* warm blue-grey for muted text on light backgrounds */
  --border-rust: rgba(255, 246, 234, 0.16);  /* warm hairline on rust bg */
  --border-light: rgba(188, 57, 8, 0.14);    /* warm hairline on cream/white bg */
  --r: 6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

a { color: var(--rust); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Site Header (matches site-revamp-phase1 Nav.astro) ── */
.site-header {
  background: var(--rust);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site-logo:hover { text-decoration: none; }

.site-logo-mark { height: 32px; width: auto; display: block; }

.site-logo-wordmark {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--cream);
}

.site-logo-sep {
  color: var(--border-rust);
  font-size: 18px;
  font-weight: 300;
  margin: 0 2px;
}

.site-logo-sub {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 246, 234, 0.65);
  letter-spacing: 0.01em;
}

.site-nav { display: flex; align-items: center; gap: 16px; }

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--cream);
  opacity: 0.75;
  text-decoration: none;
}
.nav-link:hover { opacity: 1; text-decoration: none; }

.nav-user-menu { position: relative; }

.nav-user-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--cream);
  opacity: 0.75;
  cursor: pointer;
  transition: opacity 0.15s;
}
.nav-user-trigger:hover,
.nav-user-menu:focus-within .nav-user-trigger,
.nav-user-menu:hover .nav-user-trigger { opacity: 1; }

.nav-user-chevron { width: 14px; height: 14px; opacity: 0.6; }

.nav-user-dropdown-wrap {
  position: absolute;
  right: 0;
  top: 100%;
  padding-top: 8px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 200;
}
.nav-user-menu:hover .nav-user-dropdown-wrap,
.nav-user-menu:focus-within .nav-user-dropdown-wrap {
  visibility: visible;
  opacity: 1;
}

.nav-user-dropdown {
  min-width: 240px;
  padding: 12px;
  background: var(--rust-mid);
  border: 1px solid var(--border-rust);
  border-radius: var(--r);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.nav-user-dropdown .button_to { margin: 0; }

.btn-nav-dropdown {
  display: block;
  width: 100%;
  background: rgba(255, 246, 234, 0.12);
  border: 1px solid var(--border-rust);
  color: var(--cream);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  padding: 8px 14px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}
.btn-nav-dropdown:hover { background: rgba(255, 246, 234, 0.2); }

.nav-user-meta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-rust);
}

.nav-user-meta-label {
  display: inline;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 246, 234, 0.55);
}

.nav-user-meta-value {
  display: inline;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 246, 234, 0.75);
  word-break: break-all;
  user-select: all;
}

/* Ghost nav button — kept for any secondary nav actions */
.btn-nav-ghost {
  background: rgba(255, 246, 234, 0.12);
  border: 1px solid var(--border-rust);
  color: var(--cream);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  padding: 6px 14px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-nav-ghost:hover { background: rgba(255, 246, 234, 0.2); }

/* ── Site Footer (matches stratasite Footer.astro) ── */
.site-footer {
  background: var(--ink);
  color: var(--cream);
}

.site-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 16px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

@media (min-width: 640px) {
  .site-footer-inner { padding-left: 24px; padding-right: 24px; }
}

@media (min-width: 1024px) {
  .site-footer-inner { padding-left: 32px; padding-right: 32px; }
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-mark { height: 28px; width: auto; display: block; }

.footer-wordmark {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--cream);
}

.footer-tagline {
  margin-top: 12px;
  font-size: 14px;
  color: var(--cream-muted);
  line-height: 1.625;
  max-width: 320px;
}

.footer-col-heading {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--cream);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  font-size: 14px;
}

.footer-link {
  color: var(--cream-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-link:hover { color: var(--cream); text-decoration: none; }

.footer-bottom-bar { border-top: 1px solid var(--border-rust); }

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px;
  font-size: 12px;
  color: var(--cream-muted);
}

@media (min-width: 640px) {
  .footer-bottom { padding-left: 24px; padding-right: 24px; }
}

@media (min-width: 1024px) {
  .footer-bottom { padding-left: 32px; padding-right: 32px; }
}

/* ── Flash ── */
.flash {
  padding: 13px 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}
.flash-notice { background: #ecfdf5; color: #065f46; }
.flash-alert  { background: #fff1ec; color: #7c2d12; }
.inline-flash { border-radius: var(--r); margin-bottom: 20px; text-align: left; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 24px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 700;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Primary: peach bg + deep-rust text — matches CtaButton primary variant */
.btn-primary {
  background: var(--peach);
  color: var(--rust-deep);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 194, 110, 0.45);
  filter: brightness(1.05);
  text-decoration: none;
}

/* Outline: cream border on rust — ghost variant */
.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--border-light);
}
.btn-outline:hover { border-color: var(--rust); color: var(--rust); text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  border: 1.5px solid var(--border-light);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-soft); text-decoration: none; }

.btn-sm { padding: 8px 16px; font-size: 12px; }
.btn-full { width: 100%; padding: 13px; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

.optional-label { color: var(--ink-muted); font-weight: 400; }

input[type="text"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid rgba(188, 57, 8, 0.18);
  border-radius: var(--r);
  font-size: 15px;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}

input:focus {
  outline: none;
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(188, 57, 8, 0.1);
}

input::placeholder { color: rgba(74, 94, 122, 0.5); }

/* ═══════════════════════════════════════════
   SIGN-IN / REGISTER — full-viewport split
   ═══════════════════════════════════════════ */

.page-sign-in { background: var(--rust); }

.sign-in-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* Left: rust brand panel */
.brand-panel {
  background: var(--rust);
  display: flex;
  flex-direction: column;
  padding: 48px;
}

.brand-top { margin-bottom: auto; }

.brand-logo { height: 40px; display: block; }

.brand-body { margin: auto 0 48px; }

.brand-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--peach);
  margin-bottom: 18px;
}

.brand-headline {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 52px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--cream);
  margin-bottom: 18px;
}

.brand-sub {
  font-size: 16px;
  color: var(--cream-muted);
  line-height: 1.6;
  max-width: 320px;
  opacity: 0.75;
}

/* Brand panel logo link */
.brand-panel-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.brand-panel-logo:hover { text-decoration: none; }

.brand-logo { height: 36px; width: auto; display: block; }

.brand-logo-word {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--cream);
}

/* Strata lines — geological strata / data layer signature */
.strata-lines {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.strata-lines span:nth-child(1) { display: block; height: 5px; width: 94%; border-radius: 3px; background: var(--rust-deep); }
.strata-lines span:nth-child(2) { display: block; height: 3px; width: 71%; border-radius: 3px; background: rgba(255, 246, 234, 0.2); }
.strata-lines span:nth-child(3) { display: block; height: 6px; width: 87%; border-radius: 3px; background: var(--orange); opacity: 0.7; }
.strata-lines span:nth-child(4) { display: block; height: 3px; width: 58%; border-radius: 3px; background: var(--peach); opacity: 0.4; }
.strata-lines span:nth-child(5) { display: block; height: 4px; width: 79%; border-radius: 3px; background: var(--rust-deep); opacity: 0.8; }
.strata-lines span:nth-child(6) { display: block; height: 3px; width: 42%; border-radius: 3px; background: rgba(255, 246, 234, 0.15); }

/* Right: white form panel */
.form-panel {
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.form-inner { width: 100%; max-width: 360px; }

.form-heading {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 14px;
  color: var(--ink-muted);
  margin-bottom: 28px;
}

.form-hint a { color: var(--rust); }

.form-footer {
  margin-top: 18px;
  font-size: 12px;
  color: var(--ink-muted);
  text-align: center;
}

.form-hint.muted { color: var(--ink-muted); margin-top: 8px; }

.form-footer-actions {
  margin-top: 24px;
  text-align: center;
}

.link-subtle {
  color: var(--ink-muted);
  font-size: 13px;
  text-decoration: none;
}
.link-subtle:hover { color: var(--rust); text-decoration: underline; }

.check-email-icon {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
  text-align: center;
}

/* ═══════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════ */

.dashboard {
  padding: 52px 0 80px;
  min-height: calc(100vh - 64px);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-light);
}
.dashboard-header-actions { display: flex; gap: 8px; }

.dashboard-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.dashboard-subtitle {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rust);
}

/* License document */
.license-document {
  display: grid;
  grid-template-columns: 5px 1fr;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(188, 57, 8, 0.07);
}

.license-document-stripe {
  background: linear-gradient(180deg, var(--rust) 0%, var(--orange) 100%);
}

.license-document-body { padding: 32px 36px; }

.license-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.plan-badge {
  background: var(--peach);
  color: var(--rust-deep);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

.license-issued, .license-expires {
  font-size: 13px;
  color: var(--ink-muted);
}

.license-expires::before { content: "·"; margin-right: 14px; color: var(--border-light); }

.license-card-label {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  opacity: 0.5;
}

/* Plan limits */
.plan-limits {
  display: flex;
  margin-bottom: 32px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  overflow: hidden;
  background: rgba(188, 57, 8, 0.02);
}

.limit-item {
  flex: 1;
  padding: 16px 20px;
  border-right: 1px solid var(--border-light);
}

.limit-item:last-child { border-right: none; }

.limit-value {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--rust);
  line-height: 1;
  margin-bottom: 4px;
}

.limit-value--no { color: var(--ink-muted); }
.limit-label { font-size: 12px; color: var(--ink-muted); line-height: 1.3; }

/* License key */
.license-key-section {
  border-top: 1px solid var(--border-light);
  padding-top: 24px;
}

.license-key-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.key-eye-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-light);
  cursor: pointer;
  color: var(--ink);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(2px);
  z-index: 1;
}
.key-eye-btn:hover { color: var(--rust); border-color: var(--rust); }

.license-key-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--rust);
  background: rgba(188, 57, 8, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
}

.license-key-wrap { position: relative; margin-bottom: 16px; }

.license-jwt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  background: rgba(188, 57, 8, 0.03);
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  padding: 14px 16px;
  overflow: hidden;
  max-height: 72px;
  word-break: break-all;
  white-space: pre-wrap;
  position: relative;
}

.license-jwt::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 32px;
  background: linear-gradient(transparent, rgba(255, 249, 243, 0.9));
  pointer-events: none;
}

.license-jwt--hidden {
  filter: blur(4px);
  user-select: none;
}

.license-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* No license state */
.no-license-card {
  background: white;
  border: 1.5px dashed rgba(188, 57, 8, 0.2);
  border-radius: 10px;
  padding: 64px 32px;
  text-align: center;
}

.no-license-inner { max-width: 360px; margin: 0 auto; }

.no-license-icon {
  width: 64px; height: 64px;
  background: rgba(188, 57, 8, 0.07);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  color: var(--rust);
}

.no-license-card h2 { font-size: 22px; margin-bottom: 8px; color: var(--ink); }
.no-license-card p { color: var(--ink-muted); font-size: 15px; margin-bottom: 28px; }

/* ── Expired state ── */
.license-expires--expired { color: #C0392B; font-weight: 600; }

.license-expired-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(192, 57, 43, 0.07);
  border: 1px solid rgba(192, 57, 43, 0.2);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-top: 20px;
  color: #C0392B;
  font-size: 14px;
}
.license-expired-banner span { flex: 1; }

/* ── FAQ accordion ── */
.faq {
  margin-top: 40px;
}
.faq h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--ink);
}
.faq-item {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 300;
  color: var(--rust);
  line-height: 1;
  transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  padding: 0 20px 16px;
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.7;
}

/* ── License agreement dialog ── */
.license-dialog {
  border: none;
  border-radius: 10px;
  padding: 0;
  width: min(640px, 92vw);
  max-height: 85vh;
  box-shadow: 0 24px 64px rgba(28, 43, 69, 0.18);
  overflow: hidden;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}
.license-dialog::backdrop { background: rgba(28, 43, 69, 0.5); }

.dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  padding: 28px 32px 24px;
  gap: 20px;
}
.dialog-inner h2 { font-size: 20px; }

.agreement-body {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  padding: 20px 24px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-muted);
  background: var(--cream);
}
.agreement-body h1 { font-size: 17px; margin-bottom: 12px; color: var(--ink); }
.agreement-body h2 { font-size: 14px; margin: 20px 0 6px; color: var(--ink); }
.agreement-body p { margin-bottom: 12px; }
.agreement-body ul { padding-left: 20px; margin-bottom: 12px; }
.agreement-body hr { border: none; border-top: 1px solid var(--border-light); margin: 20px 0; }
.agreement-body em { color: var(--ink); font-style: italic; }

.agreement-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink);
}
.agreement-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; accent-color: var(--rust); }

.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sign-in-layout { grid-template-columns: 1fr; }
  .brand-panel { padding: 36px 28px 32px; min-height: auto; }
  .brand-headline { font-size: 34px; }
  .brand-body { margin: 28px 0 32px; }
  .form-panel { padding: 36px 28px; align-items: flex-start; }
  .form-inner { max-width: 100%; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .plan-limits { flex-wrap: wrap; }
  .limit-item { flex: 1 1 45%; border-bottom: 1px solid var(--border-light); }
  .license-document-body { padding: 24px 20px; }
  .license-key-header { flex-direction: column; gap: 4px; }
  .site-footer-inner { grid-template-columns: 1fr; gap: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
