/* ============================================
   base.css — Reset, Typography, Global Styles
   ============================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
  padding-top: 68px;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.3rem); }
h4 { font-size: 1rem; }

p { color: var(--text-muted); line-height: 1.78; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); }

/* ===== Container ===== */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14,166,110,0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--btn-ghost-text);
  border: 1.5px solid var(--btn-ghost-border);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-accent2 {
  background: var(--accent-2);
  color: #fff;
}
.btn-accent2:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.btn-sm { padding: 0.4rem 1rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }

/* ===== Tags / Badges ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tag-text);
  background: var(--tag-bg);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.tag-blue {
  color: var(--tag-text-2);
  background: var(--tag-bg-2);
}

/* ===== Form Inputs ===== */
.input {
  width: 100%;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

.input:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px var(--accent-light);
}

textarea.input { resize: vertical; min-height: 120px; }

select.input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237d8590' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* ===== Labels ===== */
.label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

/* ===== Slider ===== */
.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: var(--bg-3);
  outline: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--bg-2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform var(--transition);
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.15); }

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

/* ===== Section helpers ===== */
.section-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: block;
}

/* ===== Divider ===== */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--text);
  color: var(--bg);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.14s; }
.reveal:nth-child(4) { transition-delay: 0.20s; }
.reveal:nth-child(5) { transition-delay: 0.26s; }
.reveal:nth-child(6) { transition-delay: 0.32s; }
.reveal:nth-child(7) { transition-delay: 0.38s; }
.reveal:nth-child(8) { transition-delay: 0.42s; }

/* ===== Info/note box ===== */
.info-box {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.warning-box {
  background: rgba(217,119,6,0.08);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ===== Result highlight ===== */
.result-highlight {
  background: var(--accent-light);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}
.result-highlight .result-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.3rem;
}
.result-highlight .result-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ===== Table ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table th {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table .amount {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
  text-align: right;
}
.data-table .highlight td {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  font-family: var(--font-display);
}
.data-table .section-head td {
  background: var(--bg-3);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
}
.data-table .deduct td { color: var(--error); }
.data-table .net-row td {
  background: rgba(14,166,110,0.06);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--success);
}

/* ===== FAQ ===== */
.faq-list { display: flex; flex-direction: column; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:first-child { border-top: 1px solid var(--border); }
.faq-q {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  padding: 1.1rem 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  user-select: none;
}
.faq-q::after { content: '+'; color: var(--accent); font-size: 1.3rem; flex-shrink: 0; transition: transform var(--transition); }
.faq-q.open::after { content: '−'; }
.faq-a { font-size: 0.9rem; line-height: 1.8; color: var(--text-muted); display: none; padding-bottom: 1rem; }
.faq-a.open { display: block; }

/* ===== Steps list ===== */
.steps-list { list-style: none; counter-reset: steps; display: flex; flex-direction: column; gap: 0.85rem; }
.steps-list li {
  counter-increment: steps;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-muted);
}
.steps-list li::before {
  content: counter(steps);
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* ===== Related cards ===== */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  transition: all var(--transition);
}
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.related-card-icon { font-size: 1.2rem; }
.related-card-name { font-family: var(--font-display); font-size: 0.85rem; font-weight: 700; color: var(--text); }

/* ===== Content sections (SEO) ===== */
.content-section { margin-top: 3rem; }
.content-section h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.content-section h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
.content-section p { font-size: 0.95rem; line-height: 1.85; margin-bottom: 1rem; }

/* ===== Checkbox ===== */
.checkbox-group { display: flex; flex-direction: column; gap: 0.6rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; }
.checkbox-label input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  body { padding-top: 60px; }
  h1 { font-size: clamp(1.8rem, 7vw, 2.4rem); }
}
