/*
 * PowerHub Tools — Enterprise Shared Styles
 * Loaded globally after powerhub.css, before @stack('styles')
 * Targets .eb-wrap pages (all tool / calculator pages)
 */

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════════════════════════ */

.eb-wrap { padding: 32px 0 88px; background: #fff; }

.eb-layout {
  display: grid;
  grid-template-columns: 1fr 296px;
  gap: 48px;
  align-items: start;
}

.eb-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BREADCRUMB
═══════════════════════════════════════════════════════════════════════════ */

.eb-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #94A3B8;
  margin-bottom: 24px;
}

.eb-breadcrumb a {
  color: #94A3B8;
  text-decoration: none;
  transition: color 0.15s;
}

.eb-breadcrumb a:hover { color: #1B2A4A; }

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR PANELS
═══════════════════════════════════════════════════════════════════════════ */

.sb-panel {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}

.sb-panel-head {
  padding: 11px 16px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #94A3B8;
}

.sb-panel-body { padding: 14px; }

.sb-tool-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 7px;
  text-decoration: none;
  font-size: 13px;
  color: #64748B;
  transition: background .12s, color .12s;
}

.sb-tool-link:hover {
  background: #F1F5F9;
  color: #1B2A4A;
}

.sb-tool-link.active {
  background: rgba(234,88,12,.08);
  color: #EA580C;
  font-weight: 700;
}

.sb-tip {
  background: linear-gradient(135deg, #FFF7ED, #FEF3C7);
  border: 1px solid #FDE68A;
  border-radius: 10px;
  padding: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARD / PANEL BASE
═══════════════════════════════════════════════════════════════════════════ */

.tool-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}

.tool-card-head {
  padding: 14px 20px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #1B2A4A;
}

.tool-card-body { padding: 24px; }

/* ═══════════════════════════════════════════════════════════════════════════
   FORM INPUTS — ENTERPRISE GRADE
═══════════════════════════════════════════════════════════════════════════ */

.eb-wrap input[type="number"],
.eb-wrap input[type="text"],
.eb-wrap input[type="email"],
.eb-wrap input[type="tel"],
.eb-wrap select,
.eb-wrap textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  color: #1B2A4A;
  background: #fff;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.eb-wrap input[type="number"]:hover,
.eb-wrap input[type="text"]:hover,
.eb-wrap input[type="email"]:hover,
.eb-wrap input[type="tel"]:hover,
.eb-wrap select:hover,
.eb-wrap textarea:hover {
  border-color: #9CA3AF;
  background: #FAFAFA;
}

.eb-wrap input[type="number"]:focus,
.eb-wrap input[type="text"]:focus,
.eb-wrap input[type="email"]:focus,
.eb-wrap input[type="tel"]:focus,
.eb-wrap select:focus,
.eb-wrap textarea:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
  background: #fff;
}

/* Remove native number arrows */
.eb-wrap input[type="number"]::-webkit-outer-spin-button,
.eb-wrap input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.eb-wrap input[type="number"] { -moz-appearance: textfield; }

/* Select custom arrow */
.eb-wrap select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
  cursor: pointer;
}

/* Field label */
.t-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Input group (label + input together) */
.t-field { margin-bottom: 18px; }

/* Hint text below input */
.t-hint {
  font-size: 12px;
  color: #94A3B8;
  margin-top: 5px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RANGE SLIDER — FULLY CUSTOM
═══════════════════════════════════════════════════════════════════════════ */

.eb-wrap input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #E2E8F0;
  outline: none;
  cursor: pointer;
  border: none;
  padding: 0;
  margin: 4px 0;
  transition: opacity .2s;
}

.eb-wrap input[type="range"]:hover { opacity: .92; }

/* Webkit thumb */
.eb-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid #1B2A4A;
  box-shadow: 0 1px 4px rgba(0,0,0,.2), 0 0 0 0 rgba(27,42,74,.15);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}

.eb-wrap input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.18);
  box-shadow: 0 2px 8px rgba(0,0,0,.22), 0 0 0 5px rgba(27,42,74,.1);
}

.eb-wrap input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.12);
  background: #F8FAFC;
}

/* Webkit track */
.eb-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
}

/* Firefox thumb */
.eb-wrap input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid #1B2A4A;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  cursor: pointer;
}

/* Firefox track */
.eb-wrap input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: #E2E8F0;
}

/* Slider with orange accent (for pages that use orange theme) */
.eb-wrap input[type="range"].t-range-orange::-webkit-slider-thumb {
  border-color: #EA580C;
}
.eb-wrap input[type="range"].t-range-orange::-moz-range-thumb {
  border-color: #EA580C;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS — ENTERPRISE COMPONENT SYSTEM
═══════════════════════════════════════════════════════════════════════════ */

.t-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all .15s;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
}

.t-btn:disabled,
.t-btn[disabled] {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — navy */
.t-btn-primary {
  background: #1B2A4A;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.t-btn-primary:hover {
  background: #243a5e;
  box-shadow: 0 4px 14px rgba(27,42,74,.28);
  transform: translateY(-1px);
}

/* Orange / CTA */
.t-btn-orange {
  background: #EA580C;
  color: #fff;
  box-shadow: 0 1px 3px rgba(234,88,12,.22);
}
.t-btn-orange:hover {
  background: #c2470a;
  box-shadow: 0 4px 14px rgba(234,88,12,.32);
  transform: translateY(-1px);
}

/* Secondary — white + border */
.t-btn-secondary {
  background: #fff;
  color: #1B2A4A;
  border: 1.5px solid #D1D5DB;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.t-btn-secondary:hover {
  border-color: #1B2A4A;
  background: #F8FAFC;
}

/* Ghost — transparent */
.t-btn-ghost {
  background: transparent;
  color: #64748B;
  border: none;
  padding: 10px 16px;
}
.t-btn-ghost:hover {
  background: #F1F5F9;
  color: #1B2A4A;
}

/* Danger */
.t-btn-danger {
  background: #EF4444;
  color: #fff;
}
.t-btn-danger:hover {
  background: #DC2626;
  box-shadow: 0 4px 14px rgba(239,68,68,.3);
  transform: translateY(-1px);
}

/* Sizes */
.t-btn-sm { padding: 8px 14px; font-size: 12.5px; }
.t-btn-lg { padding: 14px 28px; font-size: 15px; }
.t-btn-xl { padding: 16px 36px; font-size: 16px; }
.t-btn-block { width: 100%; }

/* ═══════════════════════════════════════════════════════════════════════════
   METRIC / RESULT CARDS
═══════════════════════════════════════════════════════════════════════════ */

.t-metric {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.t-metric-label {
  font-size: 10.5px;
  font-weight: 800;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: .09em;
  margin-bottom: 10px;
  display: block;
}

.t-metric-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 32px;
  font-weight: 700;
  color: #1B2A4A;
  line-height: 1;
  margin-bottom: 5px;
  display: block;
}

.t-metric-unit {
  font-size: 13px;
  color: #64748B;
  font-weight: 600;
  display: block;
}

/* Hero variant — dark navy */
.t-metric-hero {
  background: #1B2A4A;
  border-color: #1B2A4A;
}
.t-metric-hero .t-metric-label { color: #64748B; }
.t-metric-hero .t-metric-value { color: #EA580C; }
.t-metric-hero .t-metric-unit  { color: #94A3B8; }

/* Accent variants */
.t-metric-green { background: #F0FDF4; border-color: #86EFAC; }
.t-metric-green .t-metric-label { color: #16A34A; }
.t-metric-green .t-metric-value { color: #16A34A; }
.t-metric-green .t-metric-unit  { color: #4ADE80; }

.t-metric-amber { background: #FFF7ED; border-color: #FED7AA; }
.t-metric-amber .t-metric-label { color: #EA580C; }
.t-metric-amber .t-metric-value { color: #EA580C; }
.t-metric-amber .t-metric-unit  { color: #FB923C; }

/* ═══════════════════════════════════════════════════════════════════════════
   BUILDING TYPE SELECTOR (solar-sizing / wizard use)
═══════════════════════════════════════════════════════════════════════════ */

.btype-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.btype-card {
  position: relative;
  background: #fff;
  border: 2px solid #E2E8F0;
  border-radius: 16px;
  padding: 36px 20px 28px;
  cursor: pointer;
  text-align: center;
  transition: all .22s cubic-bezier(.16,1,.3,1);
  outline: none;
  overflow: hidden;
}

.btype-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(27,42,74,.05) 0%, transparent 70%);
  opacity: 0;
  transition: opacity .22s;
  pointer-events: none;
}

.btype-card:hover {
  border-color: #1B2A4A;
  box-shadow: 0 10px 32px rgba(27,42,74,.14);
  transform: translateY(-4px);
}

.btype-card:hover::after { opacity: 1; }

.btype-card:focus-visible {
  outline: 3px solid #3B82F6;
  outline-offset: 2px;
}

.btype-icon-wrap {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  transition: transform .22s cubic-bezier(.16,1,.3,1);
}

.btype-card:hover .btype-icon-wrap {
  transform: scale(1.1) rotate(-2deg);
}

.btype-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #1B2A4A;
  margin-bottom: 6px;
  line-height: 1.2;
}

.btype-desc {
  font-size: 12.5px;
  color: #94A3B8;
  line-height: 1.5;
  margin-bottom: 16px;
}

.btype-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.btype-arrow {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(-6px);
  transition: all .22s;
}

.btype-card:hover .btype-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABLES (inside tool panels)
═══════════════════════════════════════════════════════════════════════════ */

.t-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.t-table thead th {
  padding: 10px 14px;
  background: #F8FAFC;
  font-size: 11px;
  font-weight: 700;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid #E2E8F0;
  text-align: left;
}

.t-table tbody tr { transition: background .1s; }
.t-table tbody tr:hover { background: #F8FAFC; }

.t-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #F1F5F9;
  color: #374151;
  vertical-align: middle;
}

.t-table tfoot td {
  padding: 11px 14px;
  background: #1B2A4A;
  color: #94A3B8;
  font-weight: 700;
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STATUS BADGES
═══════════════════════════════════════════════════════════════════════════ */

.t-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
}

.t-badge-blue   { background: #EFF6FF; color: #1D4ED8; }
.t-badge-green  { background: #F0FDF4; color: #16A34A; }
.t-badge-amber  { background: #FFF7ED; color: #EA580C; }
.t-badge-red    { background: #FEF2F2; color: #DC2626; }
.t-badge-navy   { background: #EEF2FF; color: #1B2A4A; }
.t-badge-gray   { background: #F1F5F9; color: #475569; }

/* ═══════════════════════════════════════════════════════════════════════════
   INFO / WARNING BOXES (in-content alerts)
═══════════════════════════════════════════════════════════════════════════ */

.t-info-box {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 10px;
  margin: 16px 0;
}

.t-info-box p, .t-info-box div { color: #1E40AF; font-size: 13.5px; line-height: 1.6; margin: 0; }

.t-warn-box {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 10px;
  margin: 16px 0;
}

.t-warn-box p, .t-warn-box div { color: #92400E; font-size: 13.5px; line-height: 1.6; margin: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   PROGRESS / STEP INDICATORS
═══════════════════════════════════════════════════════════════════════════ */

.t-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  transition: all .2s;
}

.t-step-dot.done  { background: #16A34A; color: #fff; }
.t-step-dot.active { background: #1B2A4A; color: #fff; }
.t-step-dot.pending { background: #F1F5F9; color: #94A3B8; border: 2px solid #E2E8F0; }

.t-step-line {
  height: 2px;
  flex: 1;
  min-width: 8px;
  margin: 0 8px;
  border-radius: 2px;
  transition: background .2s;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ARTICLE / CONTENT SECTION
═══════════════════════════════════════════════════════════════════════════ */

.eb-article {
  margin-top: 56px;
  padding-top: 48px;
  border-top: 2px solid #E2E8F0;
}

.eb-article h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #1B2A4A;
  margin: 36px 0 12px;
  line-height: 1.25;
}

.eb-article h2:first-child { margin-top: 0; }

.eb-article h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #1B2A4A;
  margin: 28px 0 8px;
}

.eb-article p {
  font-size: 14.5px;
  color: #4B5563;
  line-height: 1.8;
  margin-bottom: 16px;
}

.eb-article ul, .eb-article ol { margin: 0 0 16px 22px; }

.eb-article li {
  font-size: 14.5px;
  color: #4B5563;
  line-height: 1.8;
  margin-bottom: 6px;
}

.eb-article .info-box {
  background: #EFF6FF;
  border-left: 4px solid #3B82F6;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 24px 0;
}
.eb-article .info-box p { margin: 0; color: #1E40AF; }

.eb-article .warn-box {
  background: #FFFBEB;
  border-left: 4px solid #F59E0B;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 24px 0;
}
.eb-article .warn-box p { margin: 0; color: #92400E; }

/* ═══════════════════════════════════════════════════════════════════════════
   CALCULATOR CARD + LABEL (shared across calc-style tools)
═══════════════════════════════════════════════════════════════════════════ */

.calc-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  margin-bottom: 20px;
}

.calc-label {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   OPTION / QUICK-SELECT BUTTONS (.t-opt-btn)
   Replace inline :style Alpine bindings across all tool pages
═══════════════════════════════════════════════════════════════════════════ */

.t-opt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #64748B;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1;
}

.t-opt-btn:hover {
  border-color: #CBD5E1;
  color: #334155;
  background: #F1F5F9;
}

.t-opt-btn.active,
.t-opt-btn[data-active="true"] {
  background: #EFF6FF;
  border-color: #2563EB;
  color: #2563EB;
  font-weight: 700;
}

.t-opt-btn-orange.active,
.t-opt-btn-orange[data-active="true"] {
  background: rgba(249,115,22,.07);
  border-color: #F97316;
  color: #EA580C;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTON UPGRADES (within .eb-wrap, overrides powerhub.css .btn)
═══════════════════════════════════════════════════════════════════════════ */

.eb-wrap .btn {
  border-radius: 8px;
  font-size: 14px;
  letter-spacing: 0;
  transition: all .18s;
}

.eb-wrap .btn:focus-visible {
  outline: 3px solid rgba(59,130,246,.45);
  outline-offset: 2px;
}

.eb-wrap .btn-primary {
  box-shadow: 0 2px 8px rgba(249,115,22,.25);
}

.eb-wrap .btn-primary:hover {
  box-shadow: 0 4px 16px rgba(249,115,22,.35);
}

.eb-wrap .btn-navy {
  box-shadow: 0 2px 8px rgba(27,42,74,.2);
}

.eb-wrap .btn-navy:hover {
  box-shadow: 0 4px 16px rgba(27,42,74,.3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .eb-layout { grid-template-columns: 1fr 280px; gap: 32px; }
}

@media (max-width: 960px) {
  .eb-layout { grid-template-columns: 1fr; }
  .eb-sidebar { position: static; }
  .btype-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .eb-wrap { padding: 24px 0 60px; }
  .btype-grid { grid-template-columns: 1fr; }
  .btype-card { padding: 28px 20px 24px; }
  .btype-icon-wrap { width: 64px; height: 64px; border-radius: 16px; }
}
