/* ===== Sklad — shared styles ===== */

:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-light: #eef2ff;
  --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --highlight: #fef3c7;
  --success: #059669;
  --success-light: #ecfdf5;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --radius: 12px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  margin: 0;
  padding: 0;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ===== Header ===== */

header.page-header {
  text-align: center;
  padding-bottom: 32px;
  margin-bottom: 40px;
  border-bottom: none;
  position: relative;
}

header.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

header.page-header h1 {
  font-size: 38px;
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

header.page-header .subtitle {
  color: var(--text-muted);
  font-size: 18px;
  margin: 0;
  font-weight: 400;
}

/* ===== Navigation ===== */

nav.page-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 40px;
}

nav.page-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

nav.page-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

nav.page-nav a.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== TOC (on index page) ===== */

nav.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-sm);
}

nav.toc h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 16px;
  font-weight: 600;
}

nav.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

nav.toc a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

nav.toc a:hover { text-decoration: underline; }

/* ===== Section card ===== */

section.service {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 44px 44px 40px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s;
}

section.service:hover {
  box-shadow: var(--shadow-lg);
}

section.service h2 {
  font-size: 28px;
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

section.service .lead {
  color: var(--text-muted);
  font-size: 17px;
  margin: 0 0 32px;
  line-height: 1.7;
}

/* ===== Headings ===== */

h3 {
  font-size: 20px;
  margin: 36px 0 14px;
  font-weight: 700;
  border-left: 4px solid var(--accent);
  padding-left: 14px;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 14px;
  margin: 28px 0 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

p { margin: 0 0 16px; }

ul.bullet {
  padding-left: 20px;
  margin: 0 0 16px;
}

ul.bullet li { margin-bottom: 6px; }

/* ===== Tables ===== */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 16px 0 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
}

table th {
  background: #f9fafb;
  text-align: left;
  padding: 14px 18px;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}

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

table tr:hover td { background: #fafbfc; }

table .price {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

table tr.total td {
  background: var(--accent-light);
  font-weight: 700;
  font-size: 16px;
  border-top: 2px solid var(--accent);
  color: var(--accent-hover);
}

table td .item-desc {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  font-weight: 400;
}

/* ===== Note block ===== */

.note {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  padding: 18px 22px;
  border-radius: 8px;
  margin: 20px 0 28px;
  font-size: 15px;
  line-height: 1.6;
}

.note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-hover);
}

.note a {
  color: var(--accent);
}

/* ===== Badge ===== */

.badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 8px;
  vertical-align: middle;
}

/* ===== Example block ===== */

.example-block {
  background: var(--success-light);
  border: 1px solid #d1fae5;
  border-radius: 10px;
  padding: 24px 28px;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}

.example-block h4 {
  color: var(--success);
  margin: 0 0 8px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 17px;
}

.example-block p.desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.example-block table {
  background: #fff;
  margin: 12px 0 0;
  box-shadow: none;
}

.example-block table th { background: #fff; }

/* ===== Rate card ===== */

.rate-card {
  background: var(--accent-light);
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  box-shadow: var(--shadow-sm);
}

.rate-item { text-align: center; }

.rate-item .rate-role {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-weight: 500;
}

.rate-item .rate-value {
  font-size: 26px;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-variant-numeric: tabular-nums;
}

/* ===== PDF download button ===== */

.pdf-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent-gradient);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s;
  box-shadow: var(--shadow-md);
  margin: 16px 0;
}

.pdf-download:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.pdf-download svg {
  width: 18px;
  height: 18px;
}

/* ===== Footer ===== */

footer.page-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 40px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
  .container { padding: 24px 16px 40px; }
  section.service { padding: 28px 20px; }
  header.page-header h1 { font-size: 28px; }
  table { font-size: 14px; }
  table th, table td { padding: 10px 14px; }
  nav.page-nav { gap: 6px; }
  nav.page-nav a { padding: 6px 12px; font-size: 13px; }
}

/* ===== Calculator ===== */

.calculator {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 36px 40px 28px;
  margin: 40px 0 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.calculator::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
  border-radius: var(--radius) var(--radius) 0 0;
}

.calculator h3 {
  border: none;
  padding: 0;
  margin: 0 0 8px;
  font-size: 22px;
  text-align: center;
}

.calculator .calc-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.calc-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  justify-content: center;
}

.calc-preset-btn {
  padding: 10px 20px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.calc-preset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.calc-preset-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.calc-preset-btn[data-preset="clear"] {
  background: #f9fafb;
  color: var(--text-muted);
  border-style: dashed;
}

.calc-preset-btn[data-preset="clear"]:hover {
  color: #dc2626;
  border-color: #dc2626;
  background: #fef2f2;
}

.calc-preset-btn[data-preset="clear"].active {
  background: #f9fafb;
  color: var(--text-muted);
  border-color: var(--border);
}

.calc-presets-data { display: none; }

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

.calc-group h4 {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.calc-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.calc-item:hover {
  background: #f9fafb;
}

.calc-item.checked {
  background: var(--accent-light);
}

.calc-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.calc-item .calc-name {
  flex: 1;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}

.calc-item .calc-name-desc {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 400;
}

.calc-item .calc-hours {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
}

.calc-item .calc-price {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  flex-shrink: 0;
  padding-top: 1px;
  min-width: 90px;
  text-align: right;
}

.calc-markup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  margin: 16px 0;
  background: #fef3c7;
  border-radius: 10px;
  border: 1px solid #fde68a;
}

.calc-markup-label {
  font-size: 14px;
  font-weight: 600;
  color: #92400e;
  white-space: nowrap;
}

.calc-markup-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.calc-markup-input {
  width: 70px;
  padding: 8px 10px;
  border: 1px solid #d4a017;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  font-family: inherit;
  background: #fff;
}

.calc-markup-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}

.calc-markup-pct {
  font-size: 15px;
  font-weight: 600;
  color: #92400e;
}

.calc-markup-result {
  font-size: 14px;
  font-weight: 600;
  color: #059669;
  margin-left: auto;
}

/* Support tiers */
.calc-support {
  margin: 20px 0;
  padding: 20px;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.calc-support h4 {
  margin: 0 0 12px;
}

.calc-support-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.calc-support-item:hover { background: #f3f4f6; }
.calc-support-item.checked { background: var(--accent-light); }

.calc-support-item input[type="radio"] {
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.calc-support-item .calc-name { flex: 1; font-size: 14px; }
.calc-support-item .calc-price {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.calc-total {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  margin: 24px -40px -28px;
  background: var(--accent);
  border-radius: 0 0 10px 10px;
  color: #fff;
  flex-wrap: wrap;
  gap: 8px;
}

.calc-total-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calc-total .calc-total-label {
  font-size: 18px;
  font-weight: 600;
}

.calc-total .calc-total-base {
  font-size: 12px;
  opacity: 0.7;
  display: none;
}

.calc-total-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
}

.calc-total .calc-total-value {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.calc-total .calc-total-monthly {
  font-size: 14px;
  opacity: 0.85;
  font-weight: 500;
}

.calc-total .calc-total-timeline {
  font-size: 13px;
  opacity: 0.75;
  font-weight: 400;
}

.calc-total .calc-total-count {
  font-size: 13px;
  opacity: 0.8;
  margin-left: 8px;
}

@media (max-width: 768px) {
  .calculator { padding: 24px 20px 20px; }
  .calc-total { margin: 20px -20px -20px; padding: 14px 20px; }
  .calc-total .calc-total-value { font-size: 22px; }
  .calc-item { padding: 8px 8px; gap: 8px; }
}

/* ===== Print ===== */

@media print {
  body { background: #fff; font-size: 14px; }
  .container { padding: 0; }
  section.service {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #ddd;
    box-shadow: none;
    margin-bottom: 24px;
    padding: 24px;
  }
  nav.toc, nav.page-nav, .pdf-download { display: none; }
  header.page-header h1 {
    -webkit-text-fill-color: var(--accent);
    background: none;
  }
  .rate-item .rate-value {
    -webkit-text-fill-color: var(--accent);
    background: none;
  }
  table { box-shadow: none; }
  .example-block { box-shadow: none; }
  .note { break-inside: avoid; }
}
