/* ==========================================================================
   IndustrCons — style.css
   Design language: "Engineering Blueprint" — deep blue + steel gray + warm
   amber accent, technical typography, drafting-line motifs.
   ========================================================================== */

/* ---------------------------- Design Tokens ---------------------------- */
:root {
  /* Brand palette */
  --primary: #1B4F8C;
  --primary-dark: #123A68;
  --primary-light: #2E7DD1;
  --accent: #E8A33D;
  --accent-dark: #C9851F;

  /* Neutral / surface */
  --bg: #F2F5F8;
  --surface: #FFFFFF;
  --surface-alt: #EAF0F6;
  --border: #DCE4EC;
  --text-primary: #16212E;
  --text-secondary: #5A6B7D;
  --text-muted: #8C9AAA;

  /* Feedback */
  --success: #1E8E5A;
  --error: #C0392B;

  /* Typography */
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", monospace;

  /* Layout */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(16, 38, 73, 0.08);
  --shadow-md: 0 8px 24px rgba(16, 38, 73, 0.10);
  --shadow-lg: 0 16px 48px rgba(16, 38, 73, 0.16);
  --header-height: 72px;
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0E1620;
  --surface: #16212E;
  --surface-alt: #1C2938;
  --border: #28384A;
  --text-primary: #E8EEF4;
  --text-secondary: #9AABBD;
  --text-muted: #6B7E92;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
}

/* ------------------------------ Reset ------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

::selection { background: var(--primary-light); color: #fff; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}

/* ------------------------------ Typography ------------------------------ */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; color: var(--text-primary); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary-light);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1.5px;
  background: var(--accent);
}
.section-heading { font-size: clamp(1.6rem, 3vw, 2.3rem); margin: 10px 0 12px; }
.section-sub { color: var(--text-secondary); max-width: 600px; font-size: 1.02rem; }
.section { padding: 88px 0; }
.section--alt { background: var(--surface-alt); }

/* ------------------------------ Loader ------------------------------ */
#pageLoader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-mark {
  width: 56px; height: 56px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}

/* ------------------------------ Header / Nav ------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 500;
  height: var(--header-height);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.18rem; }
.brand-mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 0.95rem;
  font-family: var(--font-mono);
}
.nav-menu { display: flex; align-items: center; gap: 28px; }
.nav-menu a {
  font-size: 0.92rem; font-weight: 500; color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}
.nav-menu a:hover { color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--surface);
  transition: all var(--transition);
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn svg { width: 18px; height: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.92rem;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-accent { background: var(--accent); color: #1A1303; }
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none !important; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; width: 28px; }
.nav-toggle span { height: 2px; background: var(--text-primary); border-radius: 2px; transition: all var(--transition); }
.nav-toggle--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle--open span:nth-child(2) { opacity: 0; }
.nav-toggle--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ------------------------------ Hero ------------------------------ */
.hero {
  position: relative;
  padding: 80px 0 96px;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 10%, rgba(46,125,209,0.16), transparent 45%),
    var(--bg);
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent 75%);
  opacity: 0.55;
  pointer-events: none;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.hero-title {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  line-height: 1.1;
  margin: 18px 0 18px;
}
.hero-title .accent-underline {
  position: relative;
  color: var(--primary);
}
.hero-title .accent-underline::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 2px;
  height: 10px; background: rgba(232,163,61,0.35);
  z-index: -1;
}
.hero-desc { font-size: 1.08rem; color: var(--text-secondary); max-width: 520px; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 36px; }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stat .num { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.hero-stat .label { font-size: 0.8rem; color: var(--text-secondary); }

.hero-visual {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px;
}
.hero-visual::before {
  content: "01 / SMETA.AZ";
  position: absolute; top: -11px; left: 18px;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em;
  background: var(--accent); color: #1A1303; padding: 3px 10px; border-radius: 4px;
  font-weight: 700;
}
.hero-card-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px dashed var(--border); }
.hero-card-row .l { color: var(--text-secondary); font-size: 0.86rem; }
.hero-card-row .v { font-family: var(--font-mono); font-weight: 700; }
.hero-bar { height: 8px; border-radius: 4px; background: var(--surface-alt); overflow: hidden; margin: 4px 0 18px; }
.hero-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 4px; animation: fillBar 1.4s ease forwards; }
@keyframes fillBar { from { width: 0; } }

/* ------------------------------ Generic reveal ------------------------------ */
[data-animate] { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-animate].is-visible { opacity: 1; transform: translateY(0); }
[data-animate="fade"] { transform: none; }

/* ------------------------------ Feature grid ------------------------------ */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; margin-top: 44px; }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 22px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center; color: #fff; margin-bottom: 16px;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: 0.92rem; }

/* ------------------------------ Calculator ------------------------------ */
.calc-layout { display: grid; grid-template-columns: 1fr; gap: 28px; margin-top: 40px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-sm);
}
.panel-title { font-size: 1.1rem; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.panel-title .tag { font-family: var(--font-mono); font-size: 0.7rem; background: var(--surface-alt); color: var(--text-secondary); padding: 3px 8px; border-radius: 4px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 0.83rem; font-weight: 600; color: var(--text-secondary); }
.field input, .field select, .field textarea {
  padding: 11px 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(46,125,209,0.15);
}
.field-checkbox { flex-direction: row; align-items: center; gap: 10px; }
.field-checkbox input { width: 17px; height: 17px; accent-color: var(--primary); }
.form-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }

/* ------------------------------ Results / Dashboard ------------------------------ */
#resultsSection { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; pointer-events: none; height: 0; overflow: hidden; }
#resultsSection.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; height: auto; overflow: visible; margin-top: 40px; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 100%;
  background: linear-gradient(var(--primary), var(--accent));
}
.stat-card .label { font-size: 0.78rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.stat-card .value { font-family: var(--font-mono); font-size: 1.55rem; font-weight: 700; color: var(--primary); }
.stat-card .value.accent { color: var(--accent-dark); }

.charts-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 22px; margin-bottom: 28px; }
.chart-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 22px; }
.chart-box h4 { font-size: 0.95rem; margin-bottom: 14px; }
.chart-canvas-wrap { position: relative; height: 280px; }

.data-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 22px; }
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th, table.data-table td { padding: 12px 18px; font-size: 0.88rem; border-bottom: 1px solid var(--border); }
table.data-table th { text-align: left; background: var(--surface-alt); color: var(--text-secondary); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
table.data-table tbody tr:hover { background: var(--surface-alt); }
table.data-table tbody tr:last-child td { border-bottom: none; }

/* ------------------------------ Report form ------------------------------ */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; margin-bottom: 20px; }

/* ------------------------------ Toasts ------------------------------ */
#toastContainer { position: fixed; bottom: 22px; right: 22px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary);
  padding: 14px 18px; border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  font-size: 0.88rem; max-width: 320px;
  opacity: 0; transform: translateX(20px); transition: all 0.3s ease;
}
.toast--visible { opacity: 1; transform: translateX(0); }
.toast--error { border-left-color: var(--error); }
.toast--success { border-left-color: var(--success); }

/* ------------------------------ Placeholder tool cards ------------------------------ */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: 20px; margin-top: 40px; }
.tool-card {
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-md);
  padding: 24px; text-align: left; position: relative;
}
.tool-card .badge {
  position: absolute; top: 16px; right: 16px;
  font-family: var(--font-mono); font-size: 0.65rem; text-transform: uppercase;
  background: var(--surface-alt); color: var(--text-muted); padding: 3px 9px; border-radius: 20px;
  letter-spacing: 0.05em;
}
.tool-card h3 { font-size: 1rem; margin: 10px 0 8px; }
.tool-card p { font-size: 0.87rem; color: var(--text-secondary); }

/* ------------------------------ About / process ------------------------------ */
.process-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 24px; margin-top: 40px; counter-reset: step; }
.process-item { position: relative; padding-left: 6px; }
.process-item .step-num { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent-dark); font-weight: 700; }
.process-item h3 { margin: 10px 0 8px; font-size: 1.02rem; }
.process-item p { color: var(--text-secondary); font-size: 0.9rem; }

/* ------------------------------ CTA ------------------------------ */
.cta-band {
  background: linear-gradient(120deg, var(--primary-dark), var(--primary));
  color: #fff; border-radius: var(--radius-lg);
  padding: 56px 40px; text-align: center; margin: 0 24px;
  position: relative; overflow: hidden;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.82); max-width: 520px; margin: 12px auto 26px; }

/* ------------------------------ Footer ------------------------------ */
.site-footer { background: var(--surface-alt); border-top: 1px solid var(--border); padding: 56px 0 24px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 36px; margin-bottom: 36px; }
.footer-col h4 { font-size: 0.85rem; margin-bottom: 14px; color: var(--text-primary); }
.footer-col li { margin-bottom: 9px; }
.footer-col a { font-size: 0.87rem; color: var(--text-secondary); transition: color var(--transition); }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 22px; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--text-muted); flex-wrap: wrap; gap: 10px; }

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .nav-menu {
    position: fixed; top: var(--header-height); left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: flex-start; padding: 18px 24px; gap: 16px;
    transform: translateY(-110%); opacity: 0; transition: all var(--transition);
    box-shadow: var(--shadow-md);
  }
  .nav-menu--open { transform: translateY(0); opacity: 1; }
  .nav-toggle { display: flex; }
  .section { padding: 60px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-band { margin: 0 16px; padding: 40px 22px; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
  .container { padding: 0 16px; }
}

/* ------------------------------ Print ------------------------------ */
@media print {
  .site-header, .site-footer, .hero, #toastContainer, .nav-toggle { display: none !important; }
}

/* ==========================================================================
   WIZARD
   ========================================================================== */
.wizard-progress {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 30px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.wizard-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 64px;
  position: relative;
}
.wizard-progress-step::after {
  content: "";
  position: absolute;
  top: 13px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.wizard-progress-step:last-child::after { display: none; }
.wizard-progress-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 2px solid var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  position: relative; z-index: 1;
  transition: all var(--transition);
}
.wizard-progress-label {
  font-size: 0.66rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
  max-width: 76px;
}
.wizard-progress-step.is-active .wizard-progress-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.wizard-progress-step.is-active .wizard-progress-label { color: var(--primary); font-weight: 600; }
.wizard-progress-step.is-complete .wizard-progress-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #1A1303;
}
.wizard-progress-step.is-complete::after { background: var(--accent); }

.wizard-step-title { font-size: 1.02rem; margin-bottom: 18px; color: var(--primary); }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 26px; gap: 12px; }

.wizard-review-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.wizard-review-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}
.wizard-review-label { color: var(--text-secondary); flex: 1; }
.wizard-review-value { font-weight: 600; flex: 1.4; text-align: right; }
.wizard-review-edit {
  font-size: 0.76rem; color: var(--primary); font-weight: 600;
  border: 1px solid var(--primary-light); border-radius: 20px; padding: 4px 10px;
  flex-shrink: 0;
  transition: all var(--transition);
}
.wizard-review-edit:hover { background: var(--primary); color: #fff; }

/* ==========================================================================
   ENGINEERING ACCURACY
   ========================================================================== */
.accuracy-range-box {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 18px;
}
.assumptions-list { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.assumptions-list li { font-size: 0.85rem; color: var(--text-secondary); }

/* ==========================================================================
   TIMELINE
   ========================================================================== */
.timeline-list { display: flex; flex-direction: column; gap: 14px; }
.timeline-phase-info { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 0.85rem; }
.timeline-phase-name { font-weight: 600; }
.timeline-phase-weeks { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.76rem; }
.timeline-bar-track { height: 8px; background: var(--surface-alt); border-radius: 4px; overflow: hidden; }
.timeline-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px; }

/* ==========================================================================
   BUDGET OPTIMIZER
   ========================================================================== */
.optimizer-list { display: flex; flex-direction: column; gap: 12px; }
.optimizer-card {
  background: var(--surface-alt);
  border-left: 3px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.optimizer-card-header { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 0.92rem; }
.optimizer-savings { color: var(--success); font-family: var(--font-mono); font-weight: 700; }

/* ==========================================================================
   SAVED PROJECTS
   ========================================================================== */
.saved-projects-list { display: flex; flex-direction: column; gap: 10px; }
.saved-project-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

/* ==========================================================================
   TRUST & TRANSPARENCY STRIP
   ========================================================================== */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 26px;
}
.trust-item { display: flex; flex-direction: column; gap: 4px; }
.trust-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.trust-value { font-size: 0.85rem; color: var(--text-primary); font-weight: 500; }

/* ==========================================================================
   PREMIUM LOCKED CARDS
   ========================================================================== */
.tool-card--locked { opacity: 0.82; position: relative; }
.badge--premium {
  background: linear-gradient(120deg, var(--accent), var(--accent-dark));
  color: #1A1303;
  font-weight: 700;
}

/* ==========================================================================
   MATERIAL PRICE TRENDS
   ========================================================================== */
.trend-up { color: var(--error); font-family: var(--font-mono); font-weight: 600; font-size: 0.8rem; }
.trend-down { color: var(--success); font-family: var(--font-mono); font-weight: 600; font-size: 0.8rem; }
.trend-stable { color: var(--text-muted); font-family: var(--font-mono); font-weight: 600; font-size: 0.8rem; }

/* ==========================================================================
   IC ASSISTANT WIDGET
   ========================================================================== */
.ic-assistant-toggle {
  position: fixed; bottom: 22px; right: 22px; z-index: 900;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition), background var(--transition);
}
.ic-assistant-toggle:hover { transform: scale(1.06); background: var(--primary-dark); }
.ic-assistant-toggle.is-active { background: var(--primary-dark); }

.ic-assistant-panel {
  position: fixed; bottom: 90px; right: 22px; z-index: 900;
  width: min(340px, calc(100vw - 44px));
  height: min(440px, calc(100vh - 160px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
/* Bug fix: the [hidden] attribute must win over the unconditional
   `display: flex` above, otherwise the panel stays visible even after
   closing it. #id + [hidden] has higher specificity than the plain
   class rule, so this guarantees the panel actually disappears. */
#icAssistantPanel[hidden] {
  display: none !important;
}
.ic-assistant-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  background: var(--primary);
  color: #fff;
}
.ic-assistant-header strong { font-size: 0.92rem; }
.ic-assistant-subtitle { font-size: 0.7rem; opacity: 0.85; margin-top: 2px; }
.ic-assistant-header .icon-btn { background: rgba(255,255,255,0.15); border-color: transparent; color: #fff; }
.ic-assistant-header .icon-btn:hover { background: rgba(255,255,255,0.28); }

.ic-assistant-messages {
  flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.ic-assistant-msg { font-size: 0.84rem; line-height: 1.45; padding: 10px 12px; border-radius: 10px; max-width: 88%; }
.ic-assistant-msg--bot { background: var(--surface-alt); align-self: flex-start; border-bottom-left-radius: 2px; }
.ic-assistant-msg--user { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 2px; }

.ic-assistant-form {
  display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border);
}
.ic-assistant-form input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text-primary); font-size: 0.85rem;
}
.ic-assistant-form input:focus { outline: none; border-color: var(--primary-light); }

@media (max-width: 480px) {
  .wizard-progress-label { display: none; }
  .accuracy-range-box { flex-direction: column; align-items: flex-start; gap: 10px; }
  .ic-assistant-panel { right: 12px; bottom: 84px; }
  .ic-assistant-toggle { right: 12px; bottom: 16px; }
}
