/* ============================================
   HomeCalc Tools — Global Stylesheet
   Clean, fast, SEO-optimized micro-tool site
   ============================================ */

:root {
  --primary: #1a5632;
  --primary-light: #2d7a4a;
  --primary-dark: #0f3d22;
  --accent: #e8913a;
  --accent-hover: #d17e2f;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #2d3436;
  --text-muted: #636e72;
  --border: #dfe6e9;
  --success: #00b894;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --max-width: 1100px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- HEADER ---- */
.site-header {
  background: var(--primary);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon { font-size: 1.6rem; }

nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
}

nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

/* ---- HERO ---- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 60px 24px;
  text-align: center;
  color: #fff;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* ---- MAIN CONTENT ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
}

/* ---- TOOL CARDS (homepage grid) ---- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

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

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.tool-card-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.tool-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}

.tool-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex: 1;
}

.tool-card .card-cta {
  margin-top: 20px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}

/* ---- CALCULATOR PAGES ---- */
.calc-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
}

.calc-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.calc-page .subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

.calc-form {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.form-group .help-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-light);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.btn-calculate {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-calculate:hover { background: var(--accent-hover); }
.btn-calculate:active { transform: scale(0.98); }

/* ---- RESULTS ---- */
.results {
  margin-top: 32px;
  display: none;
}

.results.visible { display: block; }

.results-header {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--primary-dark);
}

.result-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.result-row:last-child { border-bottom: none; }

.result-label {
  font-weight: 500;
  color: var(--text-muted);
}

.result-value {
  font-weight: 700;
  font-size: 1.1rem;
}

.result-total {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-top: 16px;
}

.result-total .total-label {
  font-size: 0.9rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.result-total .total-value {
  font-size: 2.2rem;
  font-weight: 800;
  margin-top: 4px;
}

.result-total .total-range {
  font-size: 0.95rem;
  opacity: 0.8;
  margin-top: 4px;
}

/* ---- AD ZONES ---- */
.ad-zone {
  background: #f0f0f0;
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  color: #999;
  font-size: 0.85rem;
  margin: 24px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- AFFILIATE BOX ---- */
.affiliate-box {
  background: linear-gradient(135deg, #fff9f0, #fff3e0);
  border: 1px solid #ffe0b2;
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
}

.affiliate-box h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.affiliate-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s;
  margin: 4px 8px 4px 0;
}

.affiliate-link:hover { background: var(--accent-hover); }

/* ---- SEO CONTENT SECTION ---- */
.seo-content {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.seo-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--primary-dark);
}

.seo-content p {
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.7;
}

/* ---- FOOTER ---- */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 32px 24px;
  margin-top: 60px;
  font-size: 0.9rem;
}

.site-footer a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .header-inner { padding: 0 16px; }
  nav { display: none; }
  .calc-page { padding: 24px 16px; }
  .result-total .total-value { font-size: 1.8rem; }
}
