/* ============================================================
   Trade Job Pricing Calculator — Shared Stylesheet
   Mobile-first, minimal, fast. No external dependencies.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Skip-to-content link for keyboard / screen reader users */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--yellow);
  color: #111;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 999;
  border-radius: 0 0 0.5rem 0;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

:root {
  --yellow:   #FCD34D;
  --yellow-dk:#B45309;
  --bg:       #111827;
  --surface:  #1F2937;
  --surface2: #374151;
  --border:   #4B5563;
  --text:     #F9FAFB;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;
  --green:    #34D399;
  --green-dk: #065F46;
  --red:      #F87171;
  --radius:   0.5rem;
  --radius-lg:0.75rem;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--yellow); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────── */
.site-header {
  background: #0D1321;
  border-bottom: 1px solid #0D1321;
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-logo-img {
  height: 36px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.site-nav a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.site-nav a:hover        { color: var(--text); border-color: var(--border); }
.site-nav a.active       { color: var(--yellow); border-color: var(--border); }

@media (max-width: 400px) {
  .site-nav a { padding: 0.35rem 0.5rem; font-size: 0.75rem; }
}

.page-hero {
  background: linear-gradient(135deg, #1a2332 0%, #111827 100%);
  border-bottom: 1px solid var(--border);
  padding: 2rem 1.25rem 1.5rem;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.page-hero h1 em {
  font-style: normal;
  color: var(--yellow);
}

.page-hero .subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

.main-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.25rem;
}

/* ── Calculator card ─────────────────────────────────── */
.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2rem;
}

.calc-section {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.calc-section:last-child { border-bottom: none; }

.calc-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--yellow);
  margin-bottom: 1rem;
}

/* ── Input grid ──────────────────────────────────────── */
.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

.input-grid.cols-1 { grid-template-columns: 1fr; }
.input-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

@media (max-width: 480px) {
  .input-grid          { grid-template-columns: 1fr; }
  .input-grid.cols-3   { grid-template-columns: 1fr 1fr; }
  .main-content        { padding: 1rem 0.875rem; }
  .calc-section        { padding: 1rem 0.875rem; }
  .export-actions      { grid-template-columns: 1fr 1fr 1fr; gap: 0.375rem; }
  .action-btn          { font-size: 0.8rem; padding: 0.65rem 0.25rem; }
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}

.input-group .hint {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: -0.15rem;
}

.input-wrap {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}

.input-wrap:focus-within {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px rgba(252,211,77,0.15);
}

.input-prefix, .input-suffix {
  padding: 0 0.625rem;
  font-size: 0.9rem;
  color: var(--text-dim);
  background: var(--surface2);
  white-space: nowrap;
  user-select: none;
  line-height: 2.75rem;
}

.input-prefix { border-right: 1px solid var(--border); }
.input-suffix { border-left: 1px solid var(--border); }

.calc-input {
  flex: 1;
  min-width: 0;
  padding: 0.625rem 0.75rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  -moz-appearance: textfield;
}

.calc-input::-webkit-outer-spin-button,
.calc-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ── Results ─────────────────────────────────────────── */
.result-hero {
  background: linear-gradient(135deg, #1c2a1a 0%, #162019 100%);
  border: 1px solid #2d4a38;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.result-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6EE7B7;
  margin-bottom: 0.25rem;
}

.result-price {
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  font-weight: 900;
  color: var(--green);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.375rem;
}

.result-hourly {
  font-size: 0.9rem;
  color: #6EE7B7;
  opacity: 0.8;
}

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

.breakdown-table tr {
  border-bottom: 1px solid var(--border);
}

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

.breakdown-table td {
  padding: 0.6rem 0;
  vertical-align: middle;
}

.breakdown-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.breakdown-table .row-label { color: var(--text-muted); }
.breakdown-table .row-hint  { font-size: 0.72rem; color: var(--text-dim); display: block; margin-top: 0.1rem; }

.breakdown-table .row-subtotal td {
  font-weight: 700;
  color: var(--text);
  padding-top: 0.875rem;
  border-top: 2px solid var(--border);
}

.breakdown-table .row-profit td:last-child { color: var(--green); }

.breakdown-table .row-tax {
  background: rgba(252,211,77,0.04);
}

.breakdown-table .row-tax td {
  font-size: 0.82rem;
  color: var(--yellow-dk);
  border: none;
  padding-top: 0.5rem;
}

.breakdown-table .row-tax td:first-child { color: var(--yellow); }

/* ── Export action buttons ───────────────────────────── */
.export-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.625rem;
  margin-top: 1.25rem;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 0.375rem;
  font-size: 0.875rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: var(--font);
  min-height: 48px;
  white-space: nowrap;
}

.action-btn:active { transform: scale(0.97); }

.btn-copy           { background: var(--yellow); color: #111; }
.btn-copy:hover     { background: #FDE68A; }
.btn-copy.copied    { background: var(--green); color: #fff; }

.btn-excel          { background: #166534; color: #fff; }
.btn-excel:hover    { background: #15803D; }

.btn-email          { background: #0E7490; color: #fff; }
.btn-email:hover    { background: #0891B2; }

/* Email quote form — inline reveal below action buttons */
.email-form {
  display: none;
  margin-top: 0.75rem;
  padding: 0.875rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.email-form.open { display: block; }
.email-form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.email-form-row { display: flex; gap: 0.5rem; }
.email-input {
  flex: 1;
  min-width: 0;
  padding: 0.625rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
}
.email-input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px rgba(252,211,77,0.15);
}
.email-send-btn {
  padding: 0.625rem 1rem;
  background: var(--yellow);
  color: #111;
  font-weight: 700;
  font-size: 0.875rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  transition: background 0.15s;
}
.email-send-btn:hover    { background: #FDE68A; }
.email-send-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.email-msg {
  font-size: 0.75rem;
  margin-top: 0.4rem;
  min-height: 1em;
  color: var(--text-dim);
}
.email-msg.error  { color: var(--red); }
.email-msg.success{ color: var(--green); }

/* ── Supporting content ──────────────────────────────── */
.content-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  margin-bottom: 1.5rem;
}

.content-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--yellow);
  margin-bottom: 0.875rem;
  letter-spacing: -0.02em;
}

.content-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.25rem 0 0.5rem;
}

.content-section p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
  max-width: 65ch;
}

.content-section p:last-child { margin-bottom: 0; }

/* ── FAQ ─────────────────────────────────────────────── */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.faq-item:first-child { padding-top: 0; }
.faq-item:last-child  { border-bottom: none; padding-bottom: 0; }

.faq-q {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.faq-a {
  color: var(--text-muted);
  font-size: 0.88rem;
  max-width: 65ch;
}

/* ── Disclaimer ──────────────────────────────────────── */
.disclaimer {
  font-size: 0.78rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* ── Footer ──────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ── Utilities ───────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Keyboard focus ring — visible only for keyboard nav, not mouse clicks */
:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Breakdown table: prevent value column from collapsing too much on narrow screens */
.breakdown-table td:first-child { width: 100%; padding-right: 0.75rem; }
.breakdown-table td:last-child   { white-space: nowrap; }

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* MONETIZATION: insert banner ad container here */
.ad-placeholder {
  /* display: none; — uncomment and wire ad script here */
}
