/*
Electrical Calculators — scoped, self-contained styling.

Marketing pages run Tailwind preflight (resets form-element defaults);
portal pages do not. Every element used inside .calc-* markup must be
fully styled here so the shared partials render identically under both
shells — do not rely on either surface's ambient styles or the browser
default stylesheet for anything under .calc-*.
*/

.calc-tile-grid, .calc-engine, .calc-disclaimer, .calc-portal-header {
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.calc-tile-grid *, .calc-engine *, .calc-disclaimer * { box-sizing: border-box; }

/* ── Tile grid (index pages) ───────────────────────────────────────── */
.calc-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.calc-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #E5E9EE;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.calc-tile:hover {
  border-color: #4DB7FF;
  box-shadow: 0 4px 20px rgba(15,23,42,0.08);
  transform: translateY(-1px);
}
.calc-tile-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #2A9BE6;
  background: rgba(77,183,255,0.14);
  padding: 3px 8px;
  border-radius: 999px;
}
.calc-tile-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(77,183,255,0.12);
  color: #2A9BE6;
  flex-shrink: 0;
}
.calc-tile-icon svg { width: 22px; height: 22px; }
.calc-tile-name {
  font-family: 'Manrope', system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #111111;
}
.calc-tile-description {
  font-size: 13px;
  line-height: 1.5;
  color: #5B6470;
}

/* ── Disclaimer box ───────────────────────────────────────────────── */
.calc-disclaimer {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 13px;
  line-height: 1.6;
  color: #92400E;
  margin-top: 28px;
}
.calc-disclaimer p { margin: 0; }
.calc-disclaimer--compact { padding: 12px 14px; font-size: 12.5px; }

/* ── Calculator engine shell (Phase 2 builds real content here) ──────── */
.calc-engine { color: #111111; font-size: 14px; }
.calc-placeholder-note { color: #5B6470; font-style: italic; margin: 0; padding: 24px 0; text-align: center; }

/* ── Form controls (ready for Phase 2) ───────────────────────────────── */
.calc-field { margin-bottom: 16px; }
.calc-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #111111;
  margin-bottom: 6px;
}
.calc-input, .calc-select {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  color: #111111;
  background: #ffffff;
  border: 1px solid #D1D5DB;
  border-radius: 10px;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1.4;
}
.calc-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6470' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}
.calc-input:focus, .calc-select:focus {
  outline: none;
  border-color: #4DB7FF;
  box-shadow: 0 0 0 3px rgba(77,183,255,0.25);
}
.calc-help-text { font-size: 12px; color: #5B6470; margin-top: 4px; }
.calc-input--readonly { background: #F7F9FB; color: #5B6470; cursor: default; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.calc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: #4DB7FF;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}
.calc-btn:hover { background: #2A9BE6; }
.calc-btn--secondary {
  color: #111111;
  background: #F7F9FB;
  border: 1px solid #E5E9EE;
}
.calc-btn--secondary:hover { background: #EEF2F6; }

/* ── Result / pass-fail badges ────────────────────────────────────── */
.calc-result { margin-top: 20px; padding-top: 16px; border-top: 1px solid #E5E9EE; }
.calc-result-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.calc-result-col {
  flex: 1 1 200px;
  min-width: 200px;
}
.calc-result-col-heading {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5B6470;
}
.calc-cable-option {
  border: 1px solid #E5E9EE;
  border-radius: 12px;
  padding: 16px;
}
.calc-cable-option + .calc-cable-option { margin-top: 12px; }
.calc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}
.calc-badge--pass { color: #067647; background: rgba(6,118,71,0.12); }
.calc-badge--fail { color: #B42318; background: rgba(180,35,24,0.12); }
.calc-working {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 12.5px;
  color: #5B6470;
  background: #F7F9FB;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .calc-tile-grid { grid-template-columns: 1fr; }
}
