/* ============================================================
   MissionFix — visual system
   Concept: diagnostic instrument panel. Dark technical hero,
   clean high-contrast light app. PC Reps steel blue.
   ============================================================ */

:root {
  /* grounds */
  --ink: #0e1420;          /* deep blue-black instrument ground */
  --ink-2: #161f30;        /* raised panel on dark */
  --paper: #eef2f7;        /* cool off-white app ground */
  --card: #ffffff;

  /* brand */
  --steel: #2a6db5;        /* PC Reps steel blue */
  --steel-deep: #1f5390;
  --steel-bright: #4d9be8; /* glow on dark */

  /* text */
  --text: #16202e;
  --muted: #5a6675;
  --dim: #9fb2ca;          /* muted on dark */
  --on-dark: #eaf1fb;

  /* lines */
  --line: #dbe3ee;
  --line-dark: rgba(255, 255, 255, 0.10);

  /* diagnostic signals (NOT the accent — reserved for findings) */
  --crit: #e5484d;
  --warn: #e8912a;
  --ok: #30a46c;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px -20px rgba(14, 20, 32, 0.35);
  --maxw: 960px;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--steel); }

/* ---------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  background: var(--ink);
  color: var(--on-dark);
  border-bottom: 1px solid var(--line-dark);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--on-dark);
}
.brand-pulse { width: 34px; height: 20px; color: var(--steel-bright); }
.brand-name {
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.02em;
}
.brand-fix { color: var(--steel-bright); }
.brand-by {
  font-size: 12px;
  font-weight: 500;
  color: var(--dim);
  letter-spacing: 0.02em;
  margin-left: 2px;
}
.scan-status {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 5px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
}
.scan-status.loaded { color: #7ee2a8; border-color: rgba(48, 163, 108, 0.4); }

main { display: block; }

/* ================================================== LANDING */
.hero {
  position: relative;
  background:
    radial-gradient(120% 90% at 50% -10%, #1a2740 0%, var(--ink) 60%);
  color: var(--on-dark);
  overflow: hidden;
  padding: 70px 22px 84px;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-dark) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(80% 70% at 50% 20%, #000 30%, transparent 75%);
  animation: drift 22s linear infinite;
}
@keyframes drift { to { background-position: 0 46px, 46px 0; } }

.hero-inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel-bright);
  margin: 0 0 18px;
}
.hero-title {
  font-size: clamp(2.1rem, 5.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin: 0 0 20px;
}
.hero-title em {
  font-style: italic;
  color: var(--steel-bright);
}
.hero-sub {
  font-size: 1.12rem;
  color: var(--dim);
  max-width: 60ch;
  margin: 0 auto 34px;
}

/* diagnostic bay — the primary-action card in the hero */
.bay {
  background: linear-gradient(180deg, var(--ink-2), #121a29);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  text-align: left;
}
.bay-head {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.bay-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(48, 163, 108, 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(48, 163, 108, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(48, 163, 108, 0); }
  100% { box-shadow: 0 0 0 0 rgba(48, 163, 108, 0); }
}

.cta-primary {
  display: block;
  text-align: center;
  text-decoration: none;
  background: var(--steel);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 15px 20px;
  border-radius: var(--radius-sm);
  transition: background 0.2s, transform 0.1s;
}
.cta-primary:hover { background: var(--steel-bright); }
.cta-primary:active { transform: translateY(1px); }
.cta-primary.sm { display: inline-block; font-size: 0.98rem; padding: 12px 22px; }

.dropzone {
  margin-top: 12px;
  border: 1.5px dashed rgba(120, 155, 200, 0.4);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  color: var(--dim);
  font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone strong { color: var(--on-dark); }
.dropzone:hover, .dropzone.dragover {
  border-color: var(--steel-bright);
  background: rgba(77, 155, 232, 0.07);
}
.cta-ghost {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--dim);
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.cta-ghost:hover { color: var(--on-dark); }

/* ---------------------------------------------------- steps */
.steps { max-width: var(--maxw); margin: 0 auto; padding: 64px 22px 20px; }
.steps-grid {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}
.step {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px 24px;
}
.step-num {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--steel);
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 1.5px solid var(--steel);
  border-radius: 8px;
  margin-bottom: 14px;
}
.step h3 { margin: 0 0 6px; font-size: 1.2rem; font-weight: 700; }
.step p { margin: 0; color: var(--muted); font-size: 0.98rem; }

/* ---------------------------------------------------- plans peek */
.plans-peek { max-width: var(--maxw); margin: 0 auto; padding: 40px 22px 72px; text-align: center; }
.plans-peek h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 24px; }
.peek-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.peek {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.peek.featured { border-color: var(--steel); box-shadow: 0 0 0 1px var(--steel); }
.peek-price { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; }
.peek-price i { font-size: 0.85rem; font-weight: 500; font-style: normal; color: var(--muted); }
.peek-name { font-weight: 700; font-size: 0.98rem; }
.peek-blurb { color: var(--muted); font-size: 0.86rem; }
.peek-note { color: var(--muted); font-size: 0.92rem; max-width: 56ch; margin: 22px auto 0; }
.peek-note em { color: var(--text); font-style: italic; }

/* ============================================= app panels (gate + chat) */
.panel {
  max-width: 780px;
  margin: 30px auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.hidden { display: none !important; }

/* ---- gate: teaser + license ---- */
#teaser-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 14px; text-wrap: balance; }
.teaser-list { list-style: none; padding: 0; margin: 0 0 14px; }
.teaser-list li {
  font-weight: 500;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border-left: 4px solid var(--line);
}
.teaser-list li.critical { border-left-color: var(--crit); }
.teaser-list li.warning { border-left-color: var(--warn); }
.teaser-list li.info { border-left-color: var(--steel); }
.teaser-summary { color: var(--muted); }

.license-box {
  margin-top: 18px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
}
.license-box label { display: block; font-weight: 600; margin-bottom: 8px; }
.license-row { display: flex; gap: 10px; }
#license-input {
  flex: 1;
  padding: 13px;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
}
#license-input:focus-visible { outline: 2px solid var(--steel); outline-offset: 1px; }
#license-btn {
  border: none;
  border-radius: var(--radius-sm);
  background: var(--steel);
  color: #fff;
  font: inherit; font-weight: 700;
  padding: 0 22px;
  cursor: pointer;
  transition: background 0.2s;
}
#license-btn:hover { background: var(--steel-bright); }
.license-error { color: var(--crit); font-size: 0.9rem; font-weight: 500; }
.license-help { font-size: 0.9rem; color: var(--muted); margin-bottom: 0; }

/* ---- chat ---- */
#chat-panel { display: flex; flex-direction: column; height: calc(100vh - 168px); max-height: 820px; }
.chat-tools {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.link-button {
  background: none; border: none; padding: 0;
  color: var(--steel); font: inherit; font-weight: 600; font-size: 0.92rem;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 12px; }
.msg {
  max-width: 86%;
  padding: 13px 16px;
  border-radius: var(--radius);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.msg.user { align-self: flex-end; background: var(--steel); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.ai.thinking { color: var(--muted); font-style: italic; display: flex; align-items: center; }
.msg.error { align-self: center; background: rgba(229, 72, 77, 0.1); color: var(--crit); font-size: 0.9rem; font-weight: 500; }
.msg code { font-family: var(--mono); background: rgba(42, 109, 181, 0.12); border-radius: 4px; padding: 1px 5px; font-size: 0.9em; }
.msg strong { font-weight: 700; }

.dots { display: inline-flex; margin-left: 3px; }
.dots span { width: 6px; height: 6px; margin-left: 4px; border-radius: 50%; background: currentColor; opacity: 0.3; animation: dot 1.2s infinite; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

.chat-form { display: flex; gap: 10px; margin-top: 14px; }
#chat-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--text);
  padding: 13px;
  font: inherit;
}
#chat-input:focus-visible { outline: 2px solid var(--steel); outline-offset: 1px; }
#send-btn {
  border: none;
  border-radius: var(--radius-sm);
  background: var(--steel);
  color: #fff;
  font: inherit; font-weight: 700;
  padding: 0 26px;
  cursor: pointer;
  transition: background 0.2s;
}
#send-btn:hover:enabled { background: var(--steel-bright); }
#send-btn:disabled { opacity: 0.55; cursor: wait; }

/* ============================================= download + checkout pages */
.page-wrap { max-width: 760px; margin: 30px auto; padding: 0 22px; }
.pcreps-logo { max-width: 220px; align-self: center; margin: 0 auto 6px; display: block; }
#upload-panel.page .pcreps-logo { display: block; }

.os-note { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 0.96rem; }
.os-note.ok { background: rgba(48, 163, 108, 0.12); }
.os-note.info { background: rgba(42, 109, 181, 0.12); }
.os-note.warn { background: rgba(232, 145, 42, 0.15); }
.os-note:empty { display: none; }

.dl-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; }
.dl-card h2 { margin: 0 0 6px; font-size: 1.25rem; font-weight: 700; }
.dl-card p { color: var(--muted); margin: 0 0 14px; }
.dl-card.dl-legacy { background: var(--paper); }
.dl-btn {
  display: inline-block;
  background: var(--steel); color: #fff;
  text-decoration: none; font-weight: 700;
  padding: 12px 24px; border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.dl-btn:hover { background: var(--steel-bright); }
.dl-help { font-size: 0.86rem; color: var(--muted); margin-top: 8px; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 18px 0; }
.plan-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; }
.plan-card h2 { margin: 0 0 4px; font-size: 1.2rem; font-weight: 700; }
.plan-price { font-size: 1.7rem; font-weight: 800; color: var(--steel); letter-spacing: -0.02em; }
.plan-price span { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.plan-card p { color: var(--muted); font-size: 0.92rem; flex: 1; margin: 8px 0 14px; }

.pay-form { display: flex; flex-direction: column; gap: 12px; }
.pay-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.pay-form input {
  padding: 12px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--text); font-family: var(--mono);
}
.pay-form input:focus-visible { outline: 2px solid var(--steel); outline-offset: 1px; }
.pay-row { display: flex; gap: 12px; }
.pay-row label { flex: 1; }
#pay-btn {
  border: none; border-radius: var(--radius-sm);
  background: var(--ok); color: #fff;
  font: inherit; font-weight: 700; font-size: 1.05rem;
  padding: 14px; cursor: pointer; margin-top: 4px;
}
#pay-btn:disabled { opacity: 0.6; cursor: wait; }
.success-box { text-align: center; }
.license-key-display {
  font-family: var(--mono); font-size: 1.4rem; letter-spacing: 2px;
  background: var(--paper); border: 2px dashed var(--steel);
  border-radius: var(--radius-sm); padding: 16px; margin: 12px 0; user-select: all;
}

/* ---------------------------------------------------- footer */
.site-footer {
  background: var(--ink);
  color: var(--dim);
  text-align: center;
  padding: 34px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.foot-brand { font-weight: 800; font-size: 1.05rem; color: var(--on-dark); }
.foot-brand span { color: var(--dim); font-weight: 500; font-size: 0.85rem; }
.foot-tag { font-style: italic; font-size: 0.95rem; color: var(--steel-bright); }
.foot-legal { font-size: 0.82rem; margin-top: 6px; }
.site-footer a { color: var(--dim); }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero { padding: 48px 18px 60px; }
  .panel { margin: 18px 14px; padding: 20px; }
  .msg { max-width: 94%; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-grid, .bay-dot, .dots span { animation: none; }
  html { scroll-behavior: auto; }
}
