/* ================================================================
   FreeByte.in — Tool Page Design System  (toolpage.css)
   Applied to all pages with class="tool-page-body"
   ================================================================ */

/* ── Body & Page Shell ──────────────────────────────────────── */
body.tool-page-body {
  background: #f1f5f9;
  min-height: 100vh;
}
body.tool-page-body main {
  background: transparent;
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}
@media(min-width:640px)  { body.tool-page-body main { padding: 1.5rem 1.5rem 3rem; } }
@media(min-width:1024px) { body.tool-page-body main { padding: 1.75rem 2rem 3.5rem; } }

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb, nav.breadcrumb, div.breadcrumb {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  color: #94a3b8;
  background: none;
  padding: 0;
  border: none;
}
.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: #4f46e5;
  font-weight: 500;
  text-decoration: none;
  transition: color 150ms;
}
.breadcrumb a:hover { color: #3730a3; text-decoration: underline; }
.breadcrumb .bc-sep {
  color: #cbd5e1;
  font-size: .85rem;
}
/* Old-style plain span as current page */
.breadcrumb span:not(.bc-sep) {
  color: #475569;
  font-weight: 600;
}
.breadcrumb .bc-current {
  color: #475569;
  font-weight: 600;
}

/* ── Tool Header ─────────────────────────────────────────────── */
.tool-header {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  position: relative;
  overflow: hidden;
}
.tool-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  border-radius: 14px 14px 0 0;
}
.tool-header h1 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -.03em;
  line-height: 1.2;
  margin-bottom: .5rem;
}
.tool-header p {
  font-size: .9rem;
  color: #64748b;
  line-height: 1.65;
  max-width: 720px;
  margin: 0;
}

/* ── Form Container ─────────────────────────────────────────── */
.form-container {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  margin-bottom: 1.25rem;
}
.form-container h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1.5px solid #f1f5f9;
}
.form-container h3 {
  font-size: .9rem;
  font-weight: 700;
  color: #0f172a;
  margin: 1.25rem 0 .75rem;
}

/* ── Two-column layout ──────────────────────────────────────── */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media(min-width:900px) {
  .calc-layout { grid-template-columns: 380px 1fr; }
  .calc-form-panel { position: sticky; top: 80px; }
}
@media(min-width:1100px) { .calc-layout { grid-template-columns: 420px 1fr; } }

.calc-form-panel {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.calc-form-panel h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1.5px solid #f1f5f9;
}
.calc-result-panel { min-width: 0; }

/* ── Form Elements ──────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: .35rem;
  letter-spacing: .01em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .625rem .875rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: .9rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0f172a;
  background: #fff;
  transition: border-color 150ms, box-shadow 150ms;
  line-height: 1.4;
}
.form-group input:hover,
.form-group select:hover { border-color: #a5b4fc; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.form-group small,
.form-group .help-text {
  display: block;
  font-size: .72rem;
  color: #94a3b8;
  margin-top: .3rem;
  line-height: 1.4;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
@media(max-width:480px) { .form-row { grid-template-columns: 1fr; } }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.5rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  font-family: 'Inter', -apple-system, sans-serif;
  cursor: pointer;
  transition: all 150ms;
  border: 2px solid transparent;
  white-space: nowrap;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
  letter-spacing: .01em;
}
.btn:hover   { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(79,70,229,.35); }
.btn:active  { transform: none; box-shadow: none; }
.btn-block   { width: 100%; }
.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
  box-shadow: none;
}
.btn-secondary:hover { background: #e2e8f0; box-shadow: none; transform: none; }
.btn-sm { padding: .4rem 1rem; font-size: .8rem; }

/* ── Results Section ────────────────────────────────────────── */
.results {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-top: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.results h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: .875rem;
  padding-bottom: .625rem;
  border-bottom: 1.5px solid #f1f5f9;
}
.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem .75rem;
  border-radius: 8px;
  background: #f8fafc;
  margin-bottom: .4rem;
  gap: .5rem;
  flex-wrap: wrap;
  border: 1px solid #f1f5f9;
}
.result-item:last-child { margin-bottom: 0; }
.result-label {
  font-size: .8rem;
  color: #64748b;
  font-weight: 500;
}
.result-value {
  font-size: .95rem;
  font-weight: 700;
  color: #0f172a;
  text-align: right;
}

/* ── Result Stat Grid ───────────────────────────────────────── */
.result-box {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  margin-bottom: 1rem;
}
.result-box h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 1.5px solid #f1f5f9;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.result-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: .875rem 1rem;
}
.result-stat.highlight {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border-color: #a5b4fc;
}
.result-stat.success {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-color: #6ee7b7;
}
.result-stat.warning {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #fcd34d;
}
.result-stat.danger {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border-color: #f87171;
}
.result-stat-label {
  font-size: .7rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .3rem;
}
.result-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}
.result-stat.highlight .result-stat-value { color: #4f46e5; }
.result-stat.success   .result-stat-value { color: #059669; }
.result-stat.warning   .result-stat-value { color: #b45309; }
.result-stat.danger    .result-stat-value { color: #dc2626; }
.result-stat-sub { font-size: .72rem; color: #64748b; margin-top: .2rem; }

/* ── Charts ─────────────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0;
}
.chart-container {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.chart-title {
  font-size: .875rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  margin-bottom: 1rem;
}
.chart-wrapper {
  position: relative;
  height: 260px;
}

/* ── Error/Success ──────────────────────────────────────────── */
.error {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  color: #dc2626;
  padding: .75rem 1rem;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  margin-top: 1rem;
}
.success-msg {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  color: #15803d;
  padding: .75rem 1rem;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  margin-top: 1rem;
}

/* ── Tool Info (SEO content) ────────────────────────────────── */
.tool-info {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.75rem;
  margin-top: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.tool-info h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 1.5rem 0 .6rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f1f5f9;
  letter-spacing: -.02em;
}
.tool-info h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.tool-info h3 {
  font-size: .95rem;
  font-weight: 700;
  color: #1e293b;
  margin: 1rem 0 .4rem;
}
.tool-info p {
  font-size: .875rem;
  color: #475569;
  line-height: 1.75;
  margin-bottom: .75rem;
}
.tool-info ul, .tool-info ol {
  padding-left: 1.25rem;
  margin-bottom: .75rem;
}
.tool-info li {
  font-size: .875rem;
  color: #475569;
  line-height: 1.65;
  margin-bottom: .35rem;
}
.tool-info strong { color: #1e293b; }
.tool-info a { color: #4f46e5; text-decoration: none; font-weight: 500; }
.tool-info a:hover { text-decoration: underline; }

/* ── Footer ─────────────────────────────────────────────────── */
.tp-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 3rem 0 0;
  margin-top: 3rem;
}
.tp-footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media(min-width:1024px) { .tp-footer-inner { padding: 0 2rem; } }
.tp-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #1e293b;
}
.tp-footer-col h4 {
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .875rem;
}
.tp-footer-col a {
  display: block;
  font-size: .78rem;
  color: #64748b;
  padding: .2rem 0;
  text-decoration: none;
  transition: color 150ms, transform 150ms;
}
.tp-footer-col a:hover { color: #e2e8f0; transform: translateX(3px); }
.tp-footer-col a.active-page { color: #a5b4fc; }
.tp-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  font-size: .75rem;
  color: #475569;
  flex-wrap: wrap;
  gap: .5rem;
}
.tp-footer-bottom a { color: #64748b; text-decoration: none; }
.tp-footer-bottom a:hover { color: #e2e8f0; }
.tp-footer-logo {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: .3rem;
  letter-spacing: -.03em;
}
.tp-footer-logo span { color: #6366f1; }

/* ── Misc overrides ─────────────────────────────────────────── */
/* Hide any legacy footer, but not the new tp-footer */
body.tool-page-body footer:not(.tp-footer) { display: none; }

/* Inline styles in old pages — normalize chart containers */
body.tool-page-body [style*="box-shadow: 0 5px"] {
  box-shadow: 0 2px 8px rgba(0,0,0,.06) !important;
  border-radius: 14px !important;
}
