@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* All styles are scoped under #sentinel-root to avoid WP theme conflicts */

#sentinel-root *,
#sentinel-root *::before,
#sentinel-root *::after {
  box-sizing: border-box;
}

#sentinel-root {
  --hs-navy: #0f1520;
  --hs-dark: #1a1f2e;
  --hs-purple: #6b21a8;
  --hs-purple-light: #9333ea;
  --hs-green: #22c55e;
  --hs-amber: #f59e0b;
  --hs-muted: #94a3b8;
  --hs-border: rgba(255,255,255,0.08);
  --hs-surface: rgba(255,255,255,0.04);
  --radius: 12px;
  --radius-sm: 8px;

  font-family: 'DM Sans', sans-serif;
  background: var(--hs-navy);
  color: #e2e8f0;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  margin: 0;
  padding: 0;

  /* Override any theme max-width constraints */
  width: 100%;
  max-width: none !important;
}

#sentinel-root .shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

#sentinel-root .badge {
  background: linear-gradient(135deg, var(--hs-purple), var(--hs-purple-light));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 8px;
}

#sentinel-root h1 {
  font-size: 26px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 4px;
  margin-top: 0;
  border: none;
  padding: 0;
  line-height: 1.3;
}

#sentinel-root .sub {
  font-size: 14px;
  color: var(--hs-muted);
  margin-bottom: 32px;
}

#sentinel-root hr {
  border: none;
  border-top: 1px solid var(--hs-border);
  margin: 28px 0;
}

#sentinel-root .slabel {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--hs-muted);
  margin-bottom: 16px;
  display: block;
}

/* UPLOAD */
#sentinel-root .upload-zone {
  border: 2px dashed rgba(147,51,234,0.3);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 14px;
  position: relative;
  background: rgba(107,33,168,0.05);
}
#sentinel-root .upload-zone:hover,
#sentinel-root .upload-zone.drag {
  border-color: var(--hs-purple-light);
  background: rgba(107,33,168,0.1);
}
#sentinel-root .upload-zone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
#sentinel-root .upload-icon { font-size: 28px; margin-bottom: 8px; display: block; }
#sentinel-root .upload-title { font-size: 14px; font-weight: 600; color: #c084fc; margin-bottom: 4px; }
#sentinel-root .upload-sub { font-size: 12px; color: var(--hs-muted); }
#sentinel-root .upload-status {
  margin-top: 10px;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  display: none;
}
#sentinel-root .upload-status.loading {
  display: block;
  background: rgba(147,51,234,0.1);
  border: 1px solid rgba(147,51,234,0.3);
  color: #c084fc;
}
#sentinel-root .upload-status.success {
  display: block;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--hs-green);
}
#sentinel-root .upload-status.error {
  display: block;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
}

/* INPUTS */
#sentinel-root .igrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
#sentinel-root .igrid.t3 { grid-template-columns: 1fr 1fr 1fr; }
#sentinel-root .igrid.t4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media(max-width:700px) { #sentinel-root .igrid.t4 { grid-template-columns: 1fr 1fr; } }
@media(max-width:600px) { #sentinel-root .igrid, #sentinel-root .igrid.t3, #sentinel-root .igrid.t4 { grid-template-columns: 1fr; } }

#sentinel-root .field {
  background: var(--hs-surface);
  border: 1px solid var(--hs-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: border-color .2s;
  /* Prevent theme scroll-reveal libraries from hiding plugin fields */
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
}
#sentinel-root .field:focus-within {
  border-color: var(--hs-purple-light);
  background: rgba(147,51,234,.05);
}
#sentinel-root .field label {
  display: block;
  font-size: 11px;
  color: var(--hs-muted);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
#sentinel-root .frow { display: flex; align-items: center; gap: 8px; }
#sentinel-root .fpre { font-size: 14px; font-weight: 500; color: var(--hs-muted); white-space: nowrap; }
#sentinel-root .field input[type=number],
#sentinel-root .field input[type=text] {
  background: transparent;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #f1f5f9;
  width: 100%;
  -moz-appearance: textfield;
  margin: 0;
  padding: 0;
  box-shadow: none;
}
#sentinel-root .field input[type=number] {
  font-family: 'DM Mono', monospace;
  font-size: 18px;
}
#sentinel-root .field input[type=number]::-webkit-inner-spin-button,
#sentinel-root .field input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; }
#sentinel-root .field input::placeholder { color: #475569; }
#sentinel-root .funit { font-size: 13px; color: var(--hs-muted); white-space: nowrap; }

/* TARIFF TOGGLES */
#sentinel-root .tgrid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 0; }
@media(max-width:580px) { #sentinel-root .tgrid { grid-template-columns: 1fr; } }
#sentinel-root .toption { position: relative; cursor: pointer; }
#sentinel-root .toption input { position: absolute; opacity: 0; width: 0; height: 0; }
#sentinel-root .tlabel {
  display: block;
  background: var(--hs-surface);
  border: 1px solid var(--hs-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all .2s;
}
#sentinel-root .toption input:checked + .tlabel {
  border-color: var(--hs-purple-light);
  background: rgba(147,51,234,.1);
}
#sentinel-root .tname { font-size: 13px; font-weight: 600; color: #f1f5f9; display: block; margin-bottom: 2px; }
#sentinel-root .tdesc { font-size: 11px; color: var(--hs-muted); display: block; }

/* TARIFF RATE PANELS */
#sentinel-root .rate-panel {
  display: none;
  margin-top: 12px;
  padding: 16px;
  background: rgba(147,51,234,0.06);
  border: 1px solid rgba(147,51,234,0.2);
  border-radius: var(--radius-sm);
}
#sentinel-root .rate-panel.visible { display: block; }
#sentinel-root .rate-panel-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #c084fc;
  margin-bottom: 12px;
}

/* SLIDER */
#sentinel-root .slider-card {
  background: var(--hs-surface);
  border: 1px solid var(--hs-border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 14px;
}
#sentinel-root .slider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
#sentinel-root .slider-lbl { font-size: 13px; color: var(--hs-muted); font-weight: 500; }
#sentinel-root .slider-val { font-family: 'DM Mono', monospace; font-size: 18px; font-weight: 500; color: var(--hs-amber); }
#sentinel-root .slider-row { display: flex; align-items: center; gap: 12px; }
#sentinel-root .slider-min, #sentinel-root .slider-max { font-size: 11px; color: var(--hs-muted); white-space: nowrap; }
#sentinel-root input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.1);
  outline: none;
  cursor: pointer;
}
#sentinel-root input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--hs-amber);
  cursor: pointer;
  border: 2px solid var(--hs-navy);
}
#sentinel-root input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--hs-amber);
  cursor: pointer;
  border: 2px solid var(--hs-navy);
}
#sentinel-root .scenario-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
#sentinel-root .scenario-lbl { font-size: 11px; color: var(--hs-muted); }
#sentinel-root .scenario-btn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--hs-border);
  background: transparent;
  color: var(--hs-muted);
  cursor: pointer;
  transition: all .2s;
  font-family: 'DM Sans', sans-serif;
}
#sentinel-root .scenario-btn:hover,
#sentinel-root .scenario-btn.active {
  border-color: var(--hs-amber);
  color: var(--hs-amber);
  background: rgba(245,158,11,0.08);
}

/* BUTTONS */
#sentinel-root .cbtn {
  width: 100%;
  background: linear-gradient(135deg, var(--hs-purple), var(--hs-purple-light));
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  padding: 16px 24px;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  margin-top: 8px;
  display: block;
}
#sentinel-root .cbtn:hover { opacity: .9; }
#sentinel-root .cbtn:active { transform: scale(.99); }
#sentinel-root .pdf-btn {
  width: 100%;
  background: transparent;
  color: var(--hs-green);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid rgba(34,197,94,0.4);
  border-radius: var(--radius);
  padding: 14px 24px;
  cursor: pointer;
  transition: all .2s;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#sentinel-root .pdf-btn:hover { background: rgba(34,197,94,0.08); border-color: var(--hs-green); }
#sentinel-root .pdf-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* RESULTS */
#sentinel-root #results { display: none; margin-top: 36px; }
#sentinel-root #results.on { display: block; }
#sentinel-root #pdf-capture { background: var(--hs-navy); padding: 32px; border-radius: var(--radius); }
#sentinel-root .rhead { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
#sentinel-root .rtitle { font-size: 20px; font-weight: 600; color: #f1f5f9; }
#sentinel-root .utag {
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.3);
  color: var(--hs-green);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
#sentinel-root .infl-badge {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  color: var(--hs-amber);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
#sentinel-root .pdf-report-header {
  background: linear-gradient(135deg, var(--hs-purple), var(--hs-purple-light));
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
#sentinel-root .pdf-report-title { font-size: 18px; font-weight: 600; color: #fff; }
#sentinel-root .pdf-report-meta { font-size: 12px; color: rgba(255,255,255,0.7); text-align: right; }
#sentinel-root .system-bar {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--hs-border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
#sentinel-root .sys-item { font-size: 12px; color: var(--hs-muted); }
#sentinel-root .sys-item strong { color: #e2e8f0; font-family: 'DM Mono', monospace; }

/* UPLIFT BANNER */
#sentinel-root .ubanner {
  background: linear-gradient(135deg, rgba(107,33,168,.3), rgba(34,197,94,.15));
  border: 1px solid rgba(147,51,234,.4);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 16px;
  text-align: center;
}
@media(max-width:640px) { #sentinel-root .ubanner { grid-template-columns: 1fr 1fr; } }
#sentinel-root .uval { font-family: 'DM Mono', monospace; font-size: 22px; font-weight: 500; color: var(--hs-green); display: block; line-height: 1.2; }
#sentinel-root .uval.p { color: #c084fc; }
#sentinel-root .ulbl { font-size: 11px; color: var(--hs-muted); display: block; margin-top: 4px; line-height: 1.4; }

/* COMPARISON CARDS */
#sentinel-root .cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media(max-width:580px) { #sentinel-root .cgrid { grid-template-columns: 1fr; } }
#sentinel-root .card { background: rgba(255,255,255,0.04); border: 1px solid var(--hs-border); border-radius: var(--radius); overflow: hidden; }
#sentinel-root .card.sc { border-color: rgba(147,51,234,.5); background: rgba(107,33,168,.12); }
#sentinel-root .chead { padding: 14px 18px; border-bottom: 1px solid var(--hs-border); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#sentinel-root .chtitle { font-size: 13px; font-weight: 600; color: var(--hs-muted); text-transform: uppercase; letter-spacing: .06em; }
#sentinel-root .card.sc .chtitle { color: #c084fc; }
#sentinel-root .rectag { background: rgba(147,51,234,.3); color: #c084fc; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; letter-spacing: .05em; text-transform: uppercase; }
#sentinel-root .ostag { background: rgba(245,158,11,.15); color: var(--hs-amber); font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; letter-spacing: .04em; text-transform: uppercase; }
#sentinel-root .cbody { padding: 18px; }
#sentinel-root .mrow { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--hs-border); }
#sentinel-root .mrow:last-child { border-bottom: none; }
#sentinel-root .mlbl { font-size: 13px; color: var(--hs-muted); max-width: 58%; }
#sentinel-root .mval { font-family: 'DM Mono', monospace; font-size: 15px; font-weight: 500; color: #f1f5f9; text-align: right; }
#sentinel-root .mval.g { color: var(--hs-green); }
#sentinel-root .mval.a { color: var(--hs-amber); }
#sentinel-root .mval.dim { color: #475569; }
#sentinel-root .mrow-total .mlbl { font-weight: 600; color: #94a3b8; }
#sentinel-root .mrow-total .mval { font-size: 17px; }

/* PDF-populated field highlight (persistent) */
#sentinel-root .field.pdf-populated { border-color: var(--hs-green); }

/* ROI number display inside .field card */
#sentinel-root .roi-num { font-family: 'DM Mono', monospace; font-size: 18px; font-weight: 500; color: #f1f5f9; }

/* CHARTS */
#sentinel-root .ccard { background: rgba(255,255,255,0.04); border: 1px solid var(--hs-border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
#sentinel-root .ctitle { font-size: 13px; font-weight: 600; color: var(--hs-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px; }
#sentinel-root .cwrap { position: relative; width: 100%; height: 200px; }
#sentinel-root .mcard { background: rgba(255,255,255,0.04); border: 1px solid var(--hs-border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
#sentinel-root .mbars { display: flex; gap: 6px; align-items: flex-end; height: 80px; margin-top: 12px; }
#sentinel-root .bgrp { flex: 1; display: flex; gap: 2px; align-items: flex-end; }
#sentinel-root .bar { flex: 1; border-radius: 3px 3px 0 0; min-height: 4px; }
#sentinel-root .bar.sb { background: var(--hs-amber); }
#sentinel-root .bar.tb { background: var(--hs-purple-light); }
#sentinel-root .mlabels { display: flex; gap: 6px; margin-top: 6px; }
#sentinel-root .mlabel { flex: 1; text-align: center; font-size: 10px; color: var(--hs-muted); }
#sentinel-root .legend { display: flex; gap: 20px; margin-top: 12px; flex-wrap: wrap; }
#sentinel-root .li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--hs-muted); }
#sentinel-root .ld { width: 10px; height: 10px; border-radius: 2px; }

/* NOTE */
#sentinel-root .note {
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
#sentinel-root .ni { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
#sentinel-root .nt { font-size: 13px; color: #cbd5e1; line-height: 1.5; }
#sentinel-root .nt strong { color: var(--hs-amber); }
#sentinel-root .disc { font-size: 11px; color: #475569; line-height: 1.6; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--hs-border); }
