/* ============================================================
   CALCULATOR PAGE STYLES — shared by every calculator page.
   Loaded alongside styles.css (which supplies tokens, .btn,
   .ad-slot, .logo, and .site-footer). Copy this file as-is
   into every new calculator page; only content changes.
   ============================================================ */

/* ============ CALC NAV (slim, replaces the marketing header) ============ */
.calc-nav{
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.calc-nav-inner{
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.back-link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--blue);
}

.back-link:hover{ color: var(--orange-dark); }

/* ============ CALC HERO ============ */
.calc-hero{
  background: var(--blue);
  padding: 40px 24px 32px;
  text-align: center;
}

.calc-hero-inner{ max-width: 720px; margin: 0 auto; }

.calc-tag{
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--blue-dark);
  background: var(--orange);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.calc-title{
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 46px);
  color: var(--white);
  margin: 0 0 14px;
  letter-spacing: 0.4px;
}

.calc-title .accent{ color: var(--orange); }

.calc-intro{
  font-size: 15.5px;
  font-weight: 500;
  color: #DCE7F7;
  max-width: 620px;
  margin: 0 auto;
}

/* ============ CALC LAYOUT ============ */
.calc-layout{
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.calc-primary{ min-width: 0; }

/* ============ INPUT FORM ============ */
.calc-form{
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 32px;
}

.calc-form h2{
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  margin: 0 0 18px;
  letter-spacing: 0;
}

.form-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.field label{
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.field input,
.field select{
  width: 100%;
  box-sizing: border-box;
  height: 48px;
  padding: 0 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
}

.field input:focus,
.field select:focus{
  border-color: var(--blue);
  outline: none;
}

.field-hint{
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 6px;
}

.btn-calculate{
  background: var(--orange);
  color: var(--ink);
  width: 100%;
  font-size: 16px;
  padding: 15px 24px;
}

.btn-calculate:hover{ background: var(--orange-dark); }

.btn-share{
  background: var(--white);
  color: var(--blue);
  border: 2px solid var(--blue);
  width: 100%;
  font-size: 14px;
  padding: 12px 20px;
  margin-bottom: 24px;
}

.btn-share:hover{ background: var(--blue-tint); }

/* ============ DASHBOARD ============ */
.dashboard{
  margin-bottom: 32px;
}

.dashboard h2{
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  margin: 0 0 16px;
}

.stat-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card{
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
}

.stat-card.stat-highlight{
  background: var(--blue);
  border-color: var(--blue);
}

.stat-label{
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-highlight .stat-label{ color: #BFD3EE; }

.stat-value{
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--blue);
  letter-spacing: 0.3px;
}

.stat-highlight .stat-value{ color: var(--white); }

.stat-unit{
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.stat-highlight .stat-unit{ color: #BFD3EE; }

/* ============ PERCENTAGE TABLE ============ */
.pct-table-wrap{
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  overflow-x: auto;
}

.pct-table-wrap h3{
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
  margin: 0 0 14px;
}

table.pct-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.pct-table th,
table.pct-table td{
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

table.pct-table th{
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

table.pct-table td{ font-weight: 600; }

table.pct-table tr:last-child td{ border-bottom: none; }

.pct-row-target td{ color: var(--blue); background: var(--blue-tint); }

/* ============ HISTORY LOG (sidebar) ============ */
.history-card{
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.history-card h3{
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
  margin: 0 0 4px;
}

.history-card > p{
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 14px;
}

#history-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
}

#history-list li{
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
}

#history-list .history-max{
  font-weight: 700;
  color: var(--blue);
}

#history-list .history-meta{
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 2px;
}

.history-empty{
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 12px 0;
}

.btn-clear-history{
  width: 100%;
  margin-top: 14px;
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
  font-size: 13px;
  padding: 10px 16px;
}

.btn-clear-history:hover{ background: var(--blue-tint); }

/* ============ EDITORIAL SECTION ============ */
.editorial{
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 32px;
}

.editorial h2{
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 21px;
  color: var(--ink);
  margin: 0 0 16px;
}

.editorial h3{
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 16.5px;
  color: var(--blue);
  margin: 28px 0 10px;
}

.editorial p{
  font-size: 15px;
  color: var(--ink);
  margin: 0 0 14px;
}

.editorial ul{
  margin: 0 0 14px;
  padding-left: 22px;
}

.editorial li{
  font-size: 15px;
  margin-bottom: 8px;
}

.editorial code{
  background: var(--blue-tint);
  color: var(--blue-dark);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13.5px;
}

/* ============ DISCLAIMER ============ */
.disclaimer{
  border: 2px solid var(--orange);
  background: #FFF7E8;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 24px;
}

.disclaimer h3{
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 14px;
  color: var(--blue-dark);
  margin: 0 0 8px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.disclaimer p{
  font-size: 13px;
  color: var(--ink);
  margin: 0;
  line-height: 1.6;
}

/* ============ SIMPLE CONTENT PAGE (legal / about) ============ */
.content-page{
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.content-page .editorial{
  margin-top: 0;
}

.content-page .page-updated{
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin: -8px 0 24px;
}

.contact-card{
  background: var(--blue-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 20px 0;
}

.contact-card a{
  color: var(--blue);
  font-weight: 700;
  border-bottom: 1px solid var(--orange);
}

/* ============ QUICK FACTS BOX ============ */
.quick-facts{
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 32px;
}

.quick-facts h2{
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--orange-dark);
  margin: 0 0 14px;
}

.quick-facts-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.quick-fact{
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.quick-fact svg{
  flex-shrink: 0;
  color: var(--blue);
  margin-top: 2px;
}

.quick-fact-label{
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.quick-fact-value{
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px){
  .calc-layout{ grid-template-columns: minmax(0, 1fr); }
  .ad-rail{ display: none; }
}

@media (max-width: 640px){
  .calc-form{ padding: 20px; }
  .editorial{ padding: 22px; }
}
