:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #1d1d29;
  --muted: #5f6678;
  --accent: #1450e2;
  --accent-dark: #0f3db0;
  --border: #dfe5f2;
  --ok-bg: #e9f7ef;
  --ok-text: #17643b;
  --err-bg: #fdecec;
  --err-text: #7b2020;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(120deg, #edf3ff, #f8fbff 45%, #eef8f6);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

.wrap {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}

.brand {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent-dark);
}

.top-nav {
  display: flex;
  gap: 1rem;
}

.top-nav a {
  color: #24304f;
  font-weight: 600;
}

.page-main {
  padding: 1.2rem 0 2rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem;
  box-shadow: 0 8px 22px rgba(19, 33, 74, 0.08);
}

.hero img {
  width: 100%;
  border-radius: 12px;
}

h1, h2, h3, h4 { margin: 0 0 0.6rem; }

.sub {
  margin: 0;
  color: var(--muted);
}

.panel {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 6px 18px rgba(16, 30, 65, 0.05);
}

.cards {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.7rem;
}

.specialist-list { grid-template-columns: 1fr; }

.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.tile, .card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 0.8rem;
}

.tile img {
  width: 100%;
  border-radius: 10px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.tile span {
  display: block;
  margin-top: 0.5rem;
  color: #1b2846;
  font-weight: 600;
}

.rate-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rate-cards article {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
}

.big {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.btn {
  display: inline-block;
  margin-top: 0.8rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-dark);
  text-decoration: none;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  color: #233049;
}

.form label.agree {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.8rem;
  font-weight: 500;
}

.form-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

input, select, textarea {
  width: 100%;
  border: 1px solid #cfd8eb;
  border-radius: 8px;
  padding: 0.55rem 0.6rem;
  font: inherit;
}

textarea { resize: vertical; }

.agree input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex: 0 0 auto;
}

.agree span {
  line-height: 1.1rem;
}

.contact-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
}

.contact-form-panel {
  margin-top: 0;
}

.contact-info-panel {
  margin-top: 0;
}

.contact-info-item + .contact-info-item {
  margin-top: 0.9rem;
}

.alert {
  border-radius: 10px;
  padding: 0.8rem;
  margin: 1rem 0;
}

.alert.ok {
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid #b9e1c7;
}

.alert.error {
  background: var(--err-bg);
  color: var(--err-text);
  border: 1px solid #f2c7c7;
}

.stats {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats div {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stats span {
  color: var(--muted);
  font-size: 0.86rem;
}

.stats strong {
  font-size: 1.02rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 0.45rem;
  text-align: left;
}

.tool-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.tool-links a {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  background: #f8faff;
}

.site-footer {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  background: #fbfcff;
}

.footer-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 1.3rem 0;
}

.footer-grid section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-note {
  margin: 0;
  text-align: center;
  padding: 0 0 1rem;
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .top-nav { display: none; }
  .form-grid,
  .grid-4,
  .grid-3,
  .rate-cards,
  .stats,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
