/* =====================================================
   Code Correct — Global Styles
   V2 locked + V3-safe
   Print-first, inspector-safe
   FULL DELETE & REPLACE
   ===================================================== */

/* =========================
   Reset / Base
   ========================= */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* =========================
   GLOBAL BACKGROUND (ALL PAGES)
   ========================= */
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: #e6e8ee;

  background-color: #0b0e14;
  background-image: url("/night-sky.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
/* Offset all content below fixed header */
body {
  padding-top: 72px;
}

/* Readability overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(11,14,20,0.65);
  z-index: -1;
}

/* =========================
   Typography (Global)
   ========================= */
h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 0.6em;
  color: #f2f4f8;
}

h1 { font-size: 36px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

p {
  margin: 0 0 1em;
  font-size: 15px;
  color: #cfd6e6;
}

.small {
  font-size: 13px;
  color: #9aa3b8;
}

a {
  color: #3282e6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* =========================
   Layout Container (Forms)
   ========================= */
.container {
  max-width: 760px;
  margin: 96px auto 120px;
  padding: 36px 32px;
  background-color: #141824;
  border-radius: 10px;
}

/* Ensure form pages NEVER inherit packet styles */
.container * {
  color: inherit;
}

/* =========================
   Navigation
   ========================= */
.cc-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 16px 28px;
  background: rgba(20, 24, 36, 0.85);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.cc-nav-left {
  font-size: 18px;
  font-weight: 600;
  color: #f2f4f8;
}

.cc-nav-right {
  display: flex;
  gap: 14px;
}

.cc-nav a {
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 500;
  color: #e6ebff;
  background: rgba(50,130,230,0.18);
  border-radius: 8px;
}

.cc-nav a:hover {
  background: rgba(50,130,230,0.35);
}

.cc-nav a.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* =========================
   Forms
   ========================= */
label {
  display: block;
  margin: 16px 0 6px;
  font-size: 14px;
  color: #cfd6e6;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.25);
  color: #e6e8ee;
}
/* Restore vertical spacing after form fields (fix Permit Type collision) */
input,
select,
textarea {
  margin-bottom: 18px;
}

input[type="radio"],
input[type="checkbox"] {
  width: auto;
}

input[type="radio"] {
  accent-color: #3282e6;
}
/* New Job: promote work description label to section header */
#workDescription {
  margin-top: 6px;
}

label[for="workDescription"] {
  display: block;
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: 500;
  color: #f2f4f8;
}

/* =========================
   Radio Groups
   ========================= */
.radio-group {
  margin-top: 10px;
  margin-bottom: 18px;
  padding-left: 8px;
  border-left: 2px solid rgba(255,255,255,0.08);
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  color: #cfd6e6;
}

/* =========================
   Buttons
   ========================= */
.btn {
  display: inline-block;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: #3282e6;
  color: #fff;
}

.btn-primary:hover {
  background: #2466b3;
}

.btn-secondary {
  background: rgba(255,255,255,0.10);
  color: #e6e8ee;
  border: 1px solid rgba(255,255,255,0.14);
}

/* =========================
   Packet Preview Actions
   ========================= */
   .preview-actions .action {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.14);
}

.preview-actions .action.primary {
  background: #3282e6;
  color: #ffffff;
  border: none;
}

.preview-actions .action.primary:hover {
  background: #2466b3;
}

.preview-actions .action.secondary {
  background: rgba(255,255,255,0.10);
  color: #e6e8ee;
}

.preview-actions .action.secondary:hover {
  background: rgba(255,255,255,0.16);
}

.preview-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;

  max-width: 760px;

  /* critical fix: clear fixed header */
  margin: 24px auto 32px;

  padding: 14px 18px;

  background: rgba(20,24,36,0.85);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;

  position: relative;
  z-index: 10;
}


/* =========================
   Packet (Print Authority)
   ========================= */
.packet {
  background: #ffffff;
  color: #222;
  padding: 36px 42px;
}

.packet h1,
.packet h2,
.packet h3,
.packet h4,
.packet p,
.packet li {
  color: #222;
}

/* =========================
   Home Page (Index Only)
   ========================= */
.home-wrap {
  max-width: 900px;
  margin: 120px auto 140px;
  padding: 0 32px;
}

.home-hero {
  margin-bottom: 64px;
}

.home-footer {
  margin-top: 80px;
  font-size: 13px;
  color: #9aa3b8;
}

/* =========================
   Print Rules (Critical)
   ========================= */
@media print {
  body {
    background: #fff !important;
    color: #000;
  }

  body::before {
    display: none !important;
  }

  .cc-nav,
  .preview-actions {
    display: none !important;
  }

  .container {
    margin: 0;
    padding: 0;
    background: none;
  }

  .packet {
    padding: 0;
  }
}
/* =========================
   PACKET V2 — OPERATOR UI
   ========================= */

.card {
  background: rgba(20, 24, 36, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px;
}

/* V2 Primary Action */
#btnGenerateV2 {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37,99,235,0.35);
}

#btnGenerateV2:hover {
  filter: brightness(1.1);
}

/* Status text */
#v2Status {
  color: #dbeafe;
  font-size: 0.95rem;
}

/* Inspector Logic Summary */
#logicSummaryCard h2 {
  margin-top: 0;
}

#logicSummaryCard h3 {
  margin-top: 18px;
  color: #93c5fd;
}

#logicSummaryCard ul {
  margin-left: 18px;
}

#logicSummaryCard li {
  color: #f1f5f9;
}

/* Meta line */
#lsMeta {
  color: #94a3b8;
  font-size: 0.85rem;
}
#bomList li {
  margin-bottom: 14px;
  color: #f1f5f9;
}

#bomList em {
  color: #93c5fd;
}
#estimateBox ul {
  margin-left: 18px;
}

#estimateBox li {
  margin-bottom: 6px;
}
#submissionBox li { margin-bottom: 6px; }
#bomList li {
  margin-bottom: 8px;
}
/* ===============================
   SUPPLY LIST EXPORT BUTTON
   =============================== */

#btnExportCSV {
  appearance: none;
  background: linear-gradient(180deg, #1e293b, #0f172a);
  border: 1px solid #334155;
  color: #e5e7eb;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

#btnExportCSV:hover {
  background: linear-gradient(180deg, #334155, #1e293b);
  border-color: #60a5fa;
}

#btnExportCSV:active {
  transform: translateY(1px);
}

#btnExportCSV:disabled {
  opacity: 0.45;
  cursor: default;
}
/* ===============================
   EXPORT BUTTON — PRIMARY STYLE
   =============================== */

.action.primary.export {
  margin-top: 6px;
  font-size: 13px;
  padding: 8px 14px;
}

/* Optional: slightly calmer hover so it doesn’t fight Generate */
.action.primary.export:hover {
  filter: brightness(1.05);
}
/* ===============================
   FORCE EXPORT BUTTON = GENERATE BUTTON
   =============================== */

#btnExportCSV {
  appearance: none;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border: 1px solid #1d4ed8;
  color: #ffffff;

  padding: 10px 16px;
  border-radius: 10px;

  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;

  cursor: pointer;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.05s ease;
}

#btnExportCSV:hover {
  background: linear-gradient(180deg, #60a5fa, #3b82f6);
  box-shadow: 0 0 0 1px rgba(59,130,246,0.6),
              0 6px 16px rgba(37,99,235,0.35);
}

#btnExportCSV:active {
  transform: translateY(1px);
}

#btnExportCSV:disabled {
  opacity: 0.45;
  cursor: default;
}
#advisoryBox ul {
  margin-left: 18px;
}

#advisoryBox li {
  margin-bottom: 6px;
}
#submissionChecklist ul {
  margin-left: 18px;
}

#submissionChecklist li {
  margin-bottom: 6px;
}
#codeReferences ul {
  margin-left: 18px;
}

#codeReferences li {
  margin-bottom: 6px;
}
#amendmentNotes ul {
  margin-left: 18px;
}

#amendmentNotes li {
  margin-bottom: 6px;
}
#aiAdvisoryBox ul {
  margin-left: 18px;
}

#aiAdvisoryBox li {
  margin-bottom: 6px;
}
