:root {
  --bg: #050607;
  --panel: #0a0c0e;
  --panel2: #101317;
  --line: #282d33;
  --text: #f2f2ef;
  --muted: #92979d;
  --gold: #f6c700;
  --green: #52d000;
  --amber: #ffb000;
  --red: #f01919;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 50% -20%, #1a1d21 0, #08090b 30%, #040506 70%);
  color: var(--text);
  font-family: Inter, sans-serif;
  min-height: 100vh;
}

/* ======================================================= */
/* GLOBAL FORM FIELDS & PERMANENT GOLD BORDERS             */
/* ======================================================= */
textarea,
select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
input:not([type]) {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  background: #0d1013;
  border: 1px solid var(--gold) !important; /* 🌟 Forces permanent crisp gold frame everywhere */
  color: #ffffff;
  border-radius: 8px;
  padding: 14px 16px;
  outline: none;
  resize: vertical;
  transition: border-color .2s ease, box-shadow .2s ease;
}

textarea:focus, 
select:focus,
input:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(246, 199, 0, 0.15) !important; /* Elegant focus ambient glow */
}

input::placeholder,
textarea::placeholder {
  color: #75808c;
  opacity: 1;
}

/* ======================================================= */
/* STRUCTURE & HEADER                                      */
/* ======================================================= */
.topbar {
  height: 74px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, 4vw);
  background: rgba(4, 5, 6, 0.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 36px 24px 70px;
}

.hero-panel,
.panel,
.result-header {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(17, 20, 24, 0.96), rgba(6, 8, 10, 0.96));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(340px, 0.72fr) minmax(560px, 1.28fr);
  gap: 56px;
  padding: 48px;
  align-items: center;
}

/* ======================================================= */
/* TYPOGRAPHY                                              */
/* ======================================================= */
.eyebrow {
  font-family: Inter, Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 16px;
}

.hero-panel h1 {
    font-family: "Inter", sans-serif;
    font-size: clamp(56px, 5.6vw, 62px);
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: -0.045em;
    max-width: 520px;
    margin: 0 0 24px;
}

.subcopy {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
  max-width: 560px;
}

.tag {
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ======================================================= */
/* ACTIONS & COMPONENT ELEMENTS                            */
/* ======================================================= */
button,
.button {
  background: var(--gold);
  border: none;
  color: #090a0b;
  font-weight: 800;
  border-radius: 8px;
  padding: 0 22px;
  letter-spacing: 1px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

/* ======================================================= */
/* ANALYZE DASHBOARD CONFIGURATION                        */
/* ======================================================= */
.analyze-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  display: grid;
  gap: 12px;
}

.analyze-form > label {
  display: block;
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text);
}

.company-row {
  display: contents;
}

.analyze-form > label:first-of-type {
  order: 1;
}

.company-row input {
  order: 2;
}

.analyze-form > label:nth-of-type(2) {
  order: 3;
  margin-top: 8px;
}

.analyze-form > input {
  order: 4;
}

.model-grid {
  order: 5;
}

.form-note {
  order: 6;
}

.company-row button {
  order: 7;
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.model-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 13px 14px;
  position: relative;
  cursor: pointer;

  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;

  font-family: Inter, Arial, sans-serif;
  color: var(--text);

  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.model-option:hover {
  border-color: #656b72;
  transform: translateY(-1px);
}

.model-option input {
  display: none;
}

.checkmark {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1px solid #59616a;
  border-radius: 4px;
  background: transparent;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.model-option input:checked + .checkmark {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: inset 0 0 0 3px var(--panel);
}

.model-option:has(input:checked) {
  border-color: var(--gold);
  background: rgba(246, 199, 0, 0.06);
  box-shadow: 0 0 0 1px rgba(246, 199, 0, 0.12);
}

.model-option strong,
.model-option small {
  display: block;
}

.model-option strong {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.model-option small {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--muted);
}

.form-note {
  margin: 4px 0 0;
  font-family: Inter, Arial, sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
}

/* ======================================================= */
/* RECENT DATA SECTION                                     */
/* ======================================================= */
.recent-section {
    margin-top: 40px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.section-heading h2 {
    margin: 0;
    font: inherit;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.section-heading span,
.view-all-link {
    color: var(--gold);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.view-all-link:hover {
    color: #ffe46b;
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.recent-card {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 10px;
    padding: 18px;
    color: var(--text);
    text-decoration: none;
    display: grid;
    gap: 7px;
    transition: .2s ease;
}

.recent-card:hover {
    border-color: #656b72;
    transform: translateY(-2px);
}

.recent-card .run-id {
    font-size: 12px;
    font-weight: 700;
    color: var(--gold);
}

.recent-card small {
    color: var(--muted);
    font-size: 13px;
}

.empty {
    border: 1px dashed var(--line);
    padding: 30px;
    text-align: center;
    color: var(--muted);
    border-radius: 10px;
}

/* ======================================================= */
/* RESULTS DATA TABLES                                     */
/* ======================================================= */
.result-header {
  padding: 30px 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-header h1 {
  font-size: 56px;
  margin-bottom: 5px;
}

.result-header p {
  color: var(--muted);
  margin: 0;
}

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

.panel {
  padding: 26px;
  margin-top: 22px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 1150px;
  background: #07090a;
}

th, td {
  border-right: 1px solid #23282d;
  border-bottom: 1px solid #23282d;
  padding: 13px 12px;
  text-align: left;
  font-size: 13px;
}

th {
  background: #111418;
  color: #aeb4ba;
  font-family: Inter, Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  font-size: 10px;
}

.stage {
  font-weight: 600;
}

.status {
  font-size: 10px;
  text-transform: uppercase;
  padding: 4px 7px;
  border-radius: 20px;
  border: 1px solid;
}

.status.ok { color: #79e544; border-color: #37781d; }
.status.demo { color: #ffd84a; border-color: #8d761c; }
.status.error { color: #ff6d6d; border-color: #7c2424; }
.error-cell { color: #ff7d7d; }

/* ======================================================= */
/* VISUAL SCORE COMPLIANCE GRAPH BAR                       */
/* ======================================================= */
.score-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 18px;
}

.company-score-card,
.insight-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #07090a;
  padding: 24px;
}

.card-company {
  font-family: Inter, Arial, sans-serif;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
}

.score-row {
  display: grid;
  grid-template-columns: 24px 110px 1fr 32px;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}

.score-rank {
  color: var(--muted);
  font-size: 11px;
}

.score-label {
  font-family: Inter, Arial, sans-serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
}

.bar-track {
  height: 17px;
  background: #14181c;
  border: 1px solid #20252a;
}

.bar-fill {
  height: 100%;
  display: block;
  background: var(--green);
  box-shadow: 0 0 15px rgba(82, 208, 0, 0.28);
}

.rank-5 { background: var(--amber); }
.rank-6, .rank-7 { background: var(--red); }

.insight-card h3 {
  font-family: Inter, Arial, sans-serif;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 16px 0 8px;
}

.insight-card > p {
  color: var(--muted);
  line-height: 1.6;
}

.metric {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 14px 0;
  font-size: 13px;
}

.metric strong {
  color: var(--gold);
}

.flash {
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 18px;
}

.flash.error {
  background: #411313;
  color: #ffb1b1;
}

/* ======================================================= */
/* REASONING CARD PANELS                                   */
/* ======================================================= */
/* Was a 2-column grid sized for the old four-model layout.
   Company Analysis now renders exactly one result, so this
   spans the same full content width as .result-header above it
   (both sit inside .shell, capped at 1500px) instead of
   stopping at ~50% width and leaving the right half empty. */
.reasoning-grid {
  display: block;
  width: 100%;
  margin-top: 22px;
}

.reasoning-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 34px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.reasoning-card p {
  color: #b7bcc1;
  line-height: 1.6;
  font-size: 14px;
  max-width: 780px;
}

.reasoning-card > .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.reasoning-card > .card-header span {
  font-size: 11px;
  color: var(--muted);
}

.analysis-summary,
.stage-summary {
  display: block;
  width: 100%;
  min-width: 0;
}

/* ======================================================= */
/* TOOLTIPS ENGINE                                         */
/* ======================================================= */
.tooltip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background-color: var(--muted, #666);
  color: #000;
  font-size: 12px;
  font-weight: bold;
  border-radius: 50%;
  cursor: help;
}

.tooltip-trigger::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  background-color: #222;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400;
  text-transform: none;
  white-space: normal;
  width: 360px;
  max-width: 420px;
  text-align: left;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  border: 1px solid #444;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
  z-index: 1000;
}

.tooltip-trigger:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

.button:focus-visible,
.nav a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

/* ======================================================= */
/* NAVIGATION & THEME INTEGRATION                          */
/* ======================================================= */
.nav-wrap {
  width: min(1460px, calc(100% - 48px));
  min-height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 270px;
  text-decoration: none;
}

.compass {
  position: relative;
  width: 54px;
  height: 54px;
  margin-right: 14px;
  flex: 0 0 auto;
}

.compass::before,
.compass::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid var(--gold);
  border-radius: 50%;
}

.compass::after {
  inset: 18px 4px;
  border: 0;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  border-radius: 0;
  transform: rotate(45deg);
}

.compass span,
.compass span::before {
  position: absolute;
  content: "";
  background: var(--gold);
}

.compass span {
  width: 1px;
  height: 54px;
  left: 50%;
  top: 0;
}

.compass span::before {
  width: 54px;
  height: 1px;
  top: 50%;
  left: -27px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-name {
  font-family: "Cormorant Garamond", serif;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.055em;
  color: #f5f3ed;
}

.brand-subtitle {
  margin-top: 7px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.33em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(22px, 3vw, 52px);
  flex: 1;
}

.main-nav a {
  position: relative;
  color: rgba(255, 255, 255, 0.9);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  transition: color 180ms ease;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
  transform: scaleX(1);
}

.main-nav a:hover { color: #ffffff; }
.main-nav a.active { color: var(--gold); }
.logout-link { color: var(--red) !important; font-weight: 600; }

/* ======================================================= */
/* RESPONSIVE MEDIA QUERIES                                */
/* ======================================================= */
@media (max-width: 650px) {
  .shell { padding: 20px 12px; }
  .hero-panel { padding: 24px; }

  .hero-panel h1 {
    font-size: 40px;
    line-height: 0.96;
    max-width: 100%;
  }

  .company-row button { min-height: 52px; }
  .model-grid { grid-template-columns: 1fr; }
  .recent-grid { grid-template-columns: 1fr; }
  .result-header {
    align-items: flex-start;
    gap: 20px;
    flex-direction: column;
  }
  .score-row { grid-template-columns: 20px 86px 1fr 28px; }
  .tag { display: none; }
}


.nav-account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* ======================================================= */
/* AUTHENTICATION PAGES                                    */
/* ======================================================= */
.auth-page {
  min-height: calc(100vh - 92px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
}

.auth-shell {
  width: min(1120px, 100%);
  min-height: 610px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.82fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(
    145deg,
    rgba(17, 20, 24, 0.97),
    rgba(6, 8, 10, 0.98)
  );
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 64px;
}

.auth-intro h1 {
  max-width: 570px;
  margin: 0;
  color: #ffffff;
  font-family: Inter, Arial, sans-serif;
  font-size: clamp(52px, 6vw, 78px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.auth-description {
  max-width: 520px;
  margin: 28px 0 0;
  color: #8fb5c8;
  font-size: 17px;
  line-height: 1.65;
}

.auth-form-side {
  display: flex;
  align-items: center;
  padding: 52px;
  border-left: 1px solid var(--line);
  background: rgba(4, 7, 9, 0.76);
}

.auth-card {
  width: 100%;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #07090b;
}

.auth-card-title {
  margin: 0 0 8px;
  color: #ffffff;
  font-family: Inter, Arial, sans-serif;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.auth-card-subtitle {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 20px;
}

.auth-form .form-group {
  display: grid;
  gap: 9px;
}

.auth-form .form-label {
  color: #eef1f2;
  font-family: Inter, Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: none;
}

.auth-form .form-input {
  min-height: 52px;
  resize: none;
}

.auth-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
  text-transform: uppercase;
}

.auth-switch {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.auth-switch a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
}

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

.auth-note {
  margin: 18px 0 0;
  color: #68747d;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.auth-flash {
  margin-bottom: 20px;
  padding: 13px 15px;
  border: 1px solid rgba(246, 199, 0, 0.45);
  border-radius: 8px;
  background: rgba(246, 199, 0, 0.08);
  color: #f5dc74;
  font-size: 14px;
  line-height: 1.45;
}

.auth-flash.error {
  border-color: rgba(240, 25, 25, 0.55);
  background: rgba(240, 25, 25, 0.11);
  color: #ffaaaa;
}

.auth-flash.success {
  border-color: rgba(82, 208, 0, 0.45);
  background: rgba(82, 208, 0, 0.08);
  color: #b5f48e;
}

@media (max-width: 900px) {
  .auth-page {
    align-items: flex-start;
    padding: 36px 18px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-intro {
    padding: 48px 36px 32px;
  }

  .auth-form-side {
    padding: 28px 36px 44px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .auth-page {
    padding: 20px 12px;
  }

  .auth-intro {
    padding: 38px 24px 26px;
  }

  .auth-intro h1 {
    font-size: 46px;
  }

  .auth-description {
    font-size: 15px;
  }

  .auth-form-side {
    padding: 18px;
  }

  .auth-card {
    padding: 24px 20px;
  }
}

.main-nav a.signup-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 14px 24px;
    min-height: 47px;

    background: #f5b800;
    color: #111;
    border: 1px solid #f5b800;
    border-radius: 4px;

    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
}

.signup-link {
    padding: 8px 16px;
    font-size: 13px;
    line-height: 1;
    border-radius: 4px;
}

select {
    background: #0b0f19;
    color: white;
}

option {
    background: #0b0f19;
    color: white;
}

.success-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    margin-top: 28px;
    padding: 0 28px;

    background: #ffd000;
    border: 1px solid #ffd000;
    border-radius: 8px;

    color: #090a0a;
    text-decoration: none;

    font-size: 13px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;

    transition: transform .15s ease, background .2s ease;
}

.success-button:hover {
    background: #ffdb2f;
    transform: translateY(-1px);
}

details summary {
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

/* ======================================================= */
/* REPORTS PAGE — STAGE PROFILE / SCORE TREND CHARTS       */
/* Stage-profile rules now live inline in reports.html's     */
/* <style> block, since reports.html does not load this      */
/* stylesheet — kept in one place to avoid duplication.      */
/* ======================================================= */

@keyframes nav-badge-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.nav-badge-pulse {
    animation: nav-badge-pulse 1.8s ease-in-out infinite;
}





