/* ==========================================================================
   Easy Tooler — shared stylesheet
   System font stack + no external dependencies for fastest page load.
   ========================================================================== */

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #eef2ff;
  --accent: #059669;
  --accent-light: #ecfdf5;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --warn: #b45309;
  --warn-light: #fffbeb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 14px rgba(15, 23, 42, 0.06);
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* --------------------------------------------------------------------------
   Header / footer
   -------------------------------------------------------------------------- */

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
}

.main-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 7px 12px;
  border-radius: 8px;
}

.main-nav a:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  margin-top: 72px;
  padding: 44px 0 28px;
  font-size: 0.92rem;
}

.site-footer .container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}

@media (max-width: 720px) {
  .site-footer .container { grid-template-columns: 1fr; }
}

.site-footer h3 {
  color: #fff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }

.site-footer a { color: #cbd5e1; text-decoration: none; }
.site-footer a:hover { color: #fff; }

.footer-legal {
  border-top: 1px solid #1e293b;
  margin-top: 36px;
  padding-top: 20px;
  font-size: 0.82rem;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 70%);
  padding: 56px 0 48px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 26px;
}

.page-hero {
  background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 70%);
  padding: 44px 0 36px;
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 10px;
}

.page-hero .lede {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn:hover { background: var(--primary-dark); color: #fff; }

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--bg); color: var(--text); }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

/* --------------------------------------------------------------------------
   Tool grid (homepage)
   -------------------------------------------------------------------------- */

.section { padding: 48px 0 8px; }

.section-title {
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.section-sub { color: var(--text-muted); margin: 0 0 28px; max-width: 640px; }

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

@media (max-width: 900px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .tool-grid { grid-template-columns: 1fr; } }

.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  color: var(--text);
}

.tool-card .tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.tool-card h2 { font-size: 1.12rem; margin: 0; letter-spacing: -0.01em; }
.tool-card p { margin: 0; color: var(--text-muted); font-size: 0.94rem; }
.tool-card .tool-cta {
  margin-top: auto;
  padding-top: 10px;
  font-weight: 700;
  color: var(--primary);
  font-size: 0.92rem;
}

/* --------------------------------------------------------------------------
   Calculator layout
   -------------------------------------------------------------------------- */

.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  padding: 40px 0 8px;
}

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

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.panel h2 { margin-top: 0; font-size: 1.2rem; letter-spacing: -0.01em; }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.field .hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

/* Results */

.result-panel { position: sticky; top: 84px; }

.result-main {
  background: var(--accent-light);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  margin-bottom: 18px;
}

.result-main .result-label {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #047857;
  margin: 0 0 4px;
}

.result-main .result-value {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  color: #065f46;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.result-main .result-note {
  color: #047857;
  font-size: 0.9rem;
  margin: 8px 0 0;
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

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

.breakdown-table th { color: var(--text-muted); font-weight: 600; width: 62%; }
.breakdown-table td { text-align: right; font-weight: 600; }

/* --------------------------------------------------------------------------
   Long-form content + FAQ
   -------------------------------------------------------------------------- */

.guide {
  padding: 40px 0 8px;
  max-width: 760px;
}

.guide h2 {
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  margin: 40px 0 12px;
}

.guide h3 { font-size: 1.15rem; margin: 28px 0 8px; }

.guide p { margin: 0 0 16px; }

.guide ul, .guide ol { padding-left: 24px; margin: 0 0 16px; }
.guide li { margin-bottom: 8px; }

.guide .callout {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.97rem;
}

.guide .example {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 20px 0;
  font-size: 0.96rem;
}

.faq { padding: 32px 0 8px; max-width: 760px; }

.faq h2 { font-size: 1.45rem; letter-spacing: -0.02em; margin: 24px 0 16px; }

.faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  padding: 0 20px;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 16px 0;
  list-style-position: outside;
}

.faq details[open] summary { color: var(--primary); }

.faq details p {
  margin: 0 0 18px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Monetization placeholder (replace with real affiliate/ads when ready)
   -------------------------------------------------------------------------- */

.affiliate-box {
  background: var(--card);
  border: 1px dashed #c7d2fe;
  border-radius: var(--radius);
  padding: 22px;
  margin: 36px 0 4px;
}

.affiliate-box .affiliate-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
}

.affiliate-box h3 { margin: 0 0 8px; font-size: 1.08rem; }
.affiliate-box p { margin: 0 0 12px; color: var(--text-muted); font-size: 0.94rem; }
.affiliate-box a { font-weight: 700; }

/* --------------------------------------------------------------------------
   Invoice generator specifics
   -------------------------------------------------------------------------- */

.line-items-table { width: 100%; border-collapse: collapse; }

.line-items-table th {
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 6px 6px;
}

.line-items-table td { padding: 4px 6px; vertical-align: top; }

.line-items-table input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.line-items-table input:focus {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
}

.line-items-table .col-desc { width: 46%; }
.line-items-table .col-qty, .line-items-table .col-rate { width: 22%; }
.line-items-table .col-total { width: 20%; text-align: right; }
.line-items-table .col-remove { width: 32px; }

.remove-row {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 8px 4px;
}

.invoice-sheet {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
  min-height: 480px;
}

.invoice-sheet .inv-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--text);
  padding-bottom: 18px;
  margin-bottom: 22px;
}

.invoice-sheet .inv-title {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 0 0 2px;
}

.invoice-sheet .inv-meta { font-size: 0.92rem; color: var(--text-muted); }

.invoice-sheet .inv-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
  font-size: 0.94rem;
}

.invoice-sheet .inv-parties h4 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.invoice-sheet .inv-items { width: 100%; border-collapse: collapse; margin-bottom: 20px; }

.invoice-sheet .inv-items th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--text);
  padding: 8px 6px;
}

.invoice-sheet .inv-items td {
  border-bottom: 1px solid var(--border);
  padding: 9px 6px;
  font-size: 0.94rem;
}

.invoice-sheet .inv-items .num { text-align: right; }

.invoice-sheet .inv-totals {
  margin-left: auto;
  width: 280px;
  font-size: 0.96rem;
}

.invoice-sheet .inv-totals .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}

.invoice-sheet .inv-totals .grand {
  border-top: 2px solid var(--text);
  font-weight: 800;
  font-size: 1.15rem;
  padding-top: 10px;
}

.invoice-sheet .inv-notes {
  margin-top: 26px;
  font-size: 0.88rem;
  color: var(--text-muted);
  white-space: pre-line;
}

/* --------------------------------------------------------------------------
   Currency combobox (see assets/js/currency-combobox.js)
   -------------------------------------------------------------------------- */

.combobox { position: relative; }

.combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow-y: auto;
  z-index: 80;
}

.combo-option {
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.95rem;
}

.combo-option:hover,
.combo-option.combo-active { background: var(--primary-light); }

.combo-option.combo-selected { font-weight: 700; color: var(--primary); }

.combo-empty {
  padding: 9px 12px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Print: the invoice generator outputs only the invoice itself, on one page.
   display:none (not visibility:hidden) so removed content also gives up its
   layout space — otherwise the printout keeps the page's full height and
   emits blank trailing pages. */
@page { margin: 12mm; }

@media print {
  body.page-invoice { background: #fff; }

  body.page-invoice .site-header,
  body.page-invoice .site-footer,
  body.page-invoice .page-hero,
  body.page-invoice .affiliate-box,
  body.page-invoice .guide,
  body.page-invoice .faq,
  body.page-invoice .related-tools,
  body.page-invoice .calc-layout > .panel:not(.result-panel) {
    display: none;
  }

  body.page-invoice .container {
    max-width: none;
    width: auto;
    padding: 0;
  }

  body.page-invoice .calc-layout {
    display: block;
    padding: 0;
  }

  body.page-invoice .result-panel {
    position: static;
    padding: 0;
    border: none;
    box-shadow: none;
  }

  body.page-invoice .result-panel > h2 { display: none; }

  body.page-invoice .invoice-sheet {
    min-height: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  /* Auto ads are injected dynamically and sit outside the sections hidden
     above — keep them off printed invoices. */
  body.page-invoice ins.adsbygoogle,
  body.page-invoice div[id^="div-gpt-ad"],
  body.page-invoice div[id^="google_ads"],
  body.page-invoice iframe[id^="google_ads"],
  body.page-invoice iframe[id^="aswift"] { display: none !important; }
}

/* --------------------------------------------------------------------------
   Misc
   -------------------------------------------------------------------------- */

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 16px 0 0;
}

.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }

.related-tools {
  padding: 44px 0 8px;
  max-width: 760px;
}

.related-tools .tool-grid { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 600px) { .related-tools .tool-grid { grid-template-columns: 1fr; } }

.updated-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 36px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}

.skip-link:focus { left: 0; }
