/* Deal Screener page. Plain styling per the build brief: white surfaces, navy text,
   gold primary button, Lato, square corners, split layout that stacks on a phone. */

:root {
  --navy: #002950;
  --navy-soft: #45607d;
  --gold: #fcd981;
  --gold-edge: #e3b94a;
  --gold-hover: #f8cd5c;
  --page: #f3f5f8;
  --surface: #ffffff;
  --line: #d4dbe4;
  --field-edge: #8fa1b6;
  --hover: #eef2f7;
  --pass: #1e7b4e;
  --pass-bg: #e6f3ec;
  --fail: #b3261e;
  --fail-bg: #fbe9e7;
  --amber: #b26a00;
  --amber-bg: #fff1dc;
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--navy);
  font-family: "Lato", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 3px solid var(--navy);
}
.brand { font-weight: 700; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--navy-soft); }
.product { font-weight: 900; font-size: 20px; }

.boot { text-align: center; padding: 48px 16px; color: var(--navy-soft); }

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 24px;
  min-width: 0;
}

/* Login */
.login { padding: 64px 16px; }
.login-panel { max-width: 400px; margin: 0 auto; }
.login-panel h1 { margin: 0 0 20px; font-size: 24px; font-weight: 900; }

/* Split layout: inputs left, results right */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  align-items: start;
}

/* Form fields */
.field-label { display: block; font-weight: 700; margin: 0 0 6px; }
.field-label.spaced { margin-top: 20px; }

input[type="text"], input[type="password"], textarea, select {
  display: block;
  width: 100%;
  font: inherit;
  color: var(--navy);
  background-color: var(--surface);
  border: 1px solid var(--field-edge);
  padding: 10px 12px;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 1px var(--navy);
}
button:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
::placeholder { color: #6b7f96; opacity: 1; }

#paste { min-height: 280px; resize: vertical; font-size: 15px; }

/* Buttons */
button { font: inherit; cursor: pointer; border-radius: 0; }
.primary {
  background: var(--gold);
  color: var(--navy);
  border: 1px solid var(--gold-edge);
  font-weight: 900;
  padding: 12px 24px;
}
.primary:hover:not(:disabled) { background: var(--gold-hover); }
.primary:disabled { opacity: 0.5; cursor: not-allowed; }
.wide { display: block; width: 100%; margin-top: 16px; font-size: 18px; }
.secondary {
  background: var(--surface);
  color: var(--navy);
  border: 1px solid var(--navy);
  font-weight: 700;
  padding: 10px 20px;
}
.secondary:hover { background: var(--hover); }
.link {
  background: none;
  border: none;
  padding: 0;
  color: var(--navy);
  text-decoration: underline;
  font-size: 15px;
}

.hint { margin: 8px 0 0; font-size: 14px; color: var(--navy-soft); }
.error {
  margin: 12px 0 0;
  padding: 10px 12px;
  color: var(--fail);
  background: var(--fail-bg);
  border-left: 4px solid var(--fail);
  font-weight: 700;
}

/* Client picker */
.combo { position: relative; }
.combo ul {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--navy);
  border-top: none;
}
.combo li { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.combo li:last-child { border-bottom: none; }
.combo li.active, .combo li:hover { background: var(--hover); }
.combo li.none { cursor: default; color: var(--navy-soft); }
.opt-name { font-weight: 700; }
.opt-label { display: block; color: var(--navy-soft); font-size: 14px; }

.buybox {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: var(--page);
  border-left: 4px solid var(--navy);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.buybox .part { display: inline-block; margin-right: 16px; }
.buybox .k { font-weight: 700; white-space: nowrap; }

/* Results */
.section-title { margin: 0 0 16px; font-size: 20px; font-weight: 900; }
.sub-title { margin: 24px 0 8px; font-size: 16px; font-weight: 900; }
.empty { margin: 0; padding: 32px 16px; text-align: center; color: var(--navy-soft); border: 1px dashed var(--line); }
.results.stale #result { opacity: 0.45; }

.banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--amber-bg);
  border-left: 4px solid var(--amber);
  font-weight: 700;
}

.verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 14px 18px;
  border: 2px solid var(--navy);
}
.verdict-word { font-size: 40px; font-weight: 900; line-height: 1.1; letter-spacing: 0.02em; }
.verdict-drivers { font-size: 18px; font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.verdict.yes { border-color: var(--pass); background: var(--pass-bg); }
.verdict.yes .verdict-word { color: var(--pass); }
.verdict.no { border-color: var(--fail); background: var(--fail-bg); }
.verdict.no .verdict-word { color: var(--fail); }
.verdict.maybe { border-color: var(--amber); background: var(--amber-bg); }
.verdict.maybe .verdict-word { color: var(--amber); }

.lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.line {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid transparent;
}
.line.fail { border-left-color: var(--fail); }
.line-label { font-weight: 700; }
.line-reason { color: var(--navy-soft); overflow-wrap: anywhere; }

.badge {
  display: block;
  text-align: center;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 4px 4px;
  white-space: nowrap;
  overflow: hidden;
  border: 1px solid transparent;
}
.badge.pass { color: var(--pass); background: var(--pass-bg); border-color: var(--pass); }
.badge.fail { color: var(--fail); background: var(--fail-bg); border-color: var(--fail); }
.badge.unknown, .badge.flag { color: var(--amber); background: var(--amber-bg); border-color: var(--amber); }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.fact { padding: 8px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.fact dt { font-size: 13px; color: var(--navy-soft); }
.fact dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.fact dd.missing { font-weight: 400; color: var(--navy-soft); }

.actions { margin-top: 20px; }

.report { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.report-form { margin-top: 4px; }
.report-form .field-label { margin-top: 12px; }
.report-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.report-status { font-size: 14px; font-weight: 700; }
.report-status.bad { color: var(--fail); }
.report-status.good { color: var(--pass); }

.footer { text-align: center; padding: 8px 16px 32px; font-weight: 700; color: var(--navy); }

/* Phone: stack the two columns */
@media (max-width: 820px) {
  .topbar { padding: 12px 16px; }
  .split { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }
  .panel { padding: 16px; }
  .login { padding: 32px 16px; }
  #paste { min-height: 180px; }
  .verdict-word { font-size: 32px; }
  .verdict-drivers { font-size: 16px; }
  .line { grid-template-columns: 84px minmax(0, 1fr); gap: 8px; padding: 10px 8px; }
  .badge { font-size: 11px; letter-spacing: 0; padding: 4px 2px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.report-hint { font-size: 13px; line-height: 1.4; color: #5a6472; margin: 4px 0 6px; }
.report-count { font-size: 12px; color: #5a6472; margin: 4px 0 8px; }
.report-count.bad { color: #b3261e; }
.footer-sep { color: #cdd9e8; margin: 0 6px; }
.footer-link { font-size: 13px; color: #3b82f6; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.footer-link:hover { color: #0f4c81; text-decoration: underline; }
