:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #17233b;
  --muted: #5b6b85;
  --accent: #2563eb;
  --accent-dark: #1e4fc4;
  --border: #e3e9f2;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(23, 35, 59, 0.07);
}

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

body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-weight: 800; font-size: 22px; color: var(--text); text-decoration: none; }
.logo span { color: var(--accent); }
.site-header nav a {
  margin-left: 24px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px;
}
.site-header nav a:hover { color: var(--accent); }

/* Hero */
.hero { padding: 90px 0 70px; text-align: center; background: linear-gradient(180deg, #eef3fb 0%, var(--bg) 100%); }
.hero h1 { font-size: 44px; line-height: 1.15; font-weight: 800; }
.hero .accent { color: var(--accent); }
.hero p { max-width: 620px; margin: 18px auto 28px; color: var(--muted); font-size: 17px; }

/* Buttons */
.btn {
  display: inline-block; border: none; cursor: pointer; text-decoration: none;
  font-family: inherit; font-weight: 600; font-size: 15px;
  padding: 12px 26px; border-radius: 10px; transition: all 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }

/* Sections */
.section { padding: 70px 0; }
.section-alt { background: #eef2f8; }
.section h2 { font-size: 30px; font-weight: 800; }
.section-sub { color: var(--muted); margin: 8px 0 32px; }

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

/* Quote layout */
.quote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.quote-form h3 { margin: 22px 0 12px; font-size: 16px; }
.quote-form h3:first-child { margin-top: 0; }
.quote-form h3 small { color: var(--muted); font-weight: 500; }

.radio-group, .check-group { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 10px 14px; cursor: pointer; transition: border-color 0.15s, background 0.15s;
  font-size: 14.5px;
}
.opt:hover { border-color: var(--accent); }
.opt.selected { border-color: var(--accent); background: #eef3fe; }
.opt input { accent-color: var(--accent); width: 17px; height: 17px; }
.opt .opt-label { flex: 1; font-weight: 600; }
.opt .opt-desc { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.opt .opt-price { color: var(--accent); font-weight: 700; white-space: nowrap; }

.pages-row { display: flex; align-items: center; gap: 16px; }
.pages-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.pages-row output { font-weight: 700; min-width: 90px; text-align: right; }

.client-fields { display: flex; flex-direction: column; gap: 10px; }
.client-fields input {
  border: 1.5px solid var(--border); border-radius: 10px; padding: 11px 14px;
  font-family: inherit; font-size: 14.5px;
}
.client-fields input:focus { outline: none; border-color: var(--accent); }

/* Quote paper */
.quote-result { position: sticky; top: 84px; }
.quote-paper h3 { font-size: 20px; margin-bottom: 2px; }
.quote-meta { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.quote-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.quote-table th {
  text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 8px 0; border-bottom: 2px solid var(--border);
}
.quote-table th:last-child, .quote-table td:last-child { text-align: right; }
.quote-table td { padding: 9px 0; border-bottom: 1px solid var(--border); }
.quote-table .row-note { color: var(--muted); font-size: 12.5px; }
.quote-total {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; padding-top: 14px; border-top: 2px solid var(--text);
  font-size: 18px; font-weight: 800;
}
.quote-total .amount { color: var(--accent); font-size: 24px; }
.quote-client { margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.quote-actions { margin-top: 20px; text-align: center; }
.quote-note { margin-top: 12px; font-size: 12px; color: var(--muted); }

/* Developers */
.badge-src {
  font-size: 12px; background: #0e2a63; color: #fff; border-radius: 999px;
  padding: 4px 12px; vertical-align: middle; font-weight: 600;
}
.dev-search { display: flex; gap: 10px; margin-bottom: 12px; }
.dev-search input {
  flex: 1; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 12px 16px; font-family: inherit; font-size: 15px; background: var(--surface);
}
.dev-search input:focus { outline: none; border-color: var(--accent); }
.dev-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chip {
  border: 1.5px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: 6px 16px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.chip:hover, .chip.active { border-color: var(--accent); color: var(--accent); background: #eef3fe; }

.dev-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.dev-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; gap: 10px;
}
.dev-head { display: flex; align-items: center; gap: 12px; }
.dev-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 18px;
}
.dev-name { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.dev-loc { color: var(--muted); font-size: 12.5px; }
.dev-stats { display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.dev-stats b { color: var(--text); }
.dev-stats .star { color: #f5a623; }
.dev-desc { font-size: 13px; color: var(--muted); flex: 1; }
.dev-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-tag {
  background: #eef2f8; border-radius: 6px; padding: 3px 9px;
  font-size: 11.5px; font-weight: 600; color: #3d4f6e;
}
.dev-link {
  margin-top: 4px; text-decoration: none; color: var(--accent); font-weight: 700; font-size: 13.5px;
}
.dev-link:hover { text-decoration: underline; }
.loading, .dev-error { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 0; }
.dev-more { text-align: center; margin-top: 28px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 26px 0; color: var(--muted); font-size: 13.5px; }
.footer-contact { margin-bottom: 14px; }
.footer-contact h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.footer-contact a { color: var(--accent); text-decoration: none; font-weight: 600; margin-right: 22px; }
.footer-contact a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 900px) {
  .quote-grid { grid-template-columns: 1fr; }
  .quote-result { position: static; }
  .dev-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 32px; }
}
@media (max-width: 560px) {
  .dev-grid { grid-template-columns: 1fr; }
  .site-header nav a { margin-left: 14px; font-size: 13.5px; }
}

/* Print — зөвхөн үнийн саналыг хэвлэнэ */
@media print {
  body { background: #fff; }
  .site-header, .hero, .quote-form, .no-print, .site-footer { display: none !important; }
  .section { padding: 0; }
  .quote-grid { grid-template-columns: 1fr; }
  .quote-result { box-shadow: none; border: none; position: static; }
  #quote h2, #quote .section-sub { display: none; }
}

/* ===================== AI ХАРЬЦУУЛАЛТ ===================== */
.ai-card { margin-top: 0; }
#ai-compare.section { padding-bottom: 0; }
.ai-card h3 { margin-bottom: 6px; }
.ai-sub { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.ai-card textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  font: inherit; font-size: 14px; color: var(--text); resize: vertical; background: var(--bg);
}
.ai-card textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.ai-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.ai-hint { color: var(--muted); font-size: 13px; }
.ai-summary { margin: 18px 0 4px; font-size: 14px; color: var(--muted); }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.compare-box {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center;
}
.compare-ours { border: 2px solid var(--accent); background: #eef3fe; }
.compare-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.compare-ours .compare-label { color: var(--accent-dark); }
.compare-badge {
  background: var(--accent); color: #fff; border-radius: 20px; padding: 2px 8px;
  font-size: 12px; font-weight: 700; margin-left: 4px;
}
.compare-price { font-size: 30px; font-weight: 800; margin-top: 6px; }
.compare-ours .compare-price { color: var(--accent); }
.compare-mnt { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ai-formula {
  margin-top: 14px; padding: 14px 18px; display: grid; gap: 6px;
  border: 1px dashed var(--border); border-radius: 10px; background: var(--bg);
}
.formula-title { font-size: 14px; font-weight: 700; }
.formula-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; flex-wrap: wrap; font-size: 14px;
}
.formula-row span { color: var(--muted); }
.formula-row code { font-family: inherit; font-weight: 700; }
.formula-note { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ai-fl-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.ai-fl-link:hover { text-decoration: underline; }
.ai-meta { margin-top: 14px; font-size: 13px; color: var(--muted); line-height: 2; }
.ai-table { margin-top: 12px; }
@media (max-width: 640px) { .compare-grid { grid-template-columns: 1fr; } }
