/* ==========================================================================
   med-docs.org — global stylesheet
   Palette and section rules follow "ТЗ по визуальному стилю и цветам сайта"
   ========================================================================== */

:root {
  --green: #16A34A;
  --green-hover: #128040;
  --green-dark: #075E3B;
  --bg: #FFFFFF;
  --bg-tint: #F0F9F3;
  --bg-chip: #E5F5E9;
  --catalog-bg: #F7FAF8;
  --text: #20272B;
  --text-muted: #5E686D;
  --border: #E2E9E4;
  --footer-muted: #D8E9DF;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(7, 94, 59, .06);
  --shadow-hover: 0 8px 24px rgba(7, 94, 59, .12);
  --header-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (min-width: 1240px) {
  html { scroll-padding-top: 120px; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

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

h1, h2, h3 { color: var(--green-dark); line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.55rem, 4.4vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 3.2vw, 1.9rem); }
h3 { font-size: clamp(1.05rem, 2.2vw, 1.25rem); }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.25em; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
.container--wide { max-width: 1300px; }

.section { padding: 44px 0; }
.section--tint { background: var(--bg-tint); }
.section--catalog { background: var(--catalog-bg); }
.section-head { text-align: center; margin-bottom: 28px; }
.section-head p { color: var(--text-muted); max-width: 720px; margin-inline: auto; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border: 0; border-radius: var(--radius-sm);
  background: var(--green); color: #fff; font: inherit; font-weight: 600;
  cursor: pointer; transition: background .18s ease, transform .18s ease;
}
.btn:hover { background: var(--green-hover); color: #fff; transform: translateY(-1px); }
.btn--block { width: 100%; }

/* ==========================================================================
   Header
   ========================================================================== */
.header {
  position: sticky; top: 0; z-index: 60;
  background: #fff; border-bottom: 1px solid var(--border);
}
.header__inner {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--header-h);
}
.logo { flex: 0 0 auto; margin-right: auto; }
.logo img { height: 38px; width: auto; }

.header__navbar { display: none; border-top: 1px solid var(--border); background: #fff; }
.nav__list {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 2px 16px; list-style: none; margin: 0; padding: 0;
}
.nav__list a {
  display: block; padding: 9px 0; font-size: 13.5px; font-weight: 500;
  color: var(--text); line-height: 1.3; white-space: nowrap;
}
.nav__list a:hover { color: var(--green); }
.nav__list a[aria-current="page"] { color: var(--green); font-weight: 700; }

.header__tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
}
.icon-btn img { width: 30px; height: 30px; }

.header__phone { display: none; align-items: center; gap: 8px; color: var(--green); font-weight: 700; white-space: nowrap; }
.header__phone img { width: 26px; height: 26px; }
.header__phone-icon { display: inline-flex; }

.lang {
  display: flex; align-items: center; border: 1px solid var(--border);
  border-radius: 999px; overflow: hidden; flex: 0 0 auto;
}
.lang a {
  padding: 5px 10px; font-size: 12.5px; font-weight: 700; color: var(--text-muted);
  line-height: 1.2; text-transform: uppercase;
}
.lang a[aria-current="true"] { background: var(--green); color: #fff; }

@media (max-width: 1239px) {
  .lang { border-color: var(--green); }
  .lang a[aria-current="true"] { display: none; }
  .lang a { padding: 7px 11px; font-size: 12.5px; color: var(--green); font-weight: 700; }
}

.burger {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 38px; padding: 0 8px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: #fff; cursor: pointer; flex: 0 0 auto;
}
.burger span { display: block; height: 2px; background: var(--green-dark); border-radius: 2px; transition: transform .2s, opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none; border-top: 1px solid var(--border); background: #fff;
  max-height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.mobile-nav.is-open { display: block; }
.mobile-nav ul { list-style: none; margin: 0; padding: 6px 0 12px; }
.mobile-nav a {
  display: block; padding: 11px 4px; color: var(--text); font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.mobile-nav a[aria-current="page"] { color: var(--green); font-weight: 700; }
.mobile-nav__phone { display: flex; align-items: center; gap: 8px; padding: 12px 4px; color: var(--green); font-weight: 700; }
.mobile-nav__phone img { width: 24px; height: 24px; }

@media (max-width: 480px) {
  .container { padding-inline: 12px; }
  .logo img { height: 32px; }
  .header__tools { gap: 6px; }
  .icon-btn { width: 34px; height: 34px; }
  .icon-btn img { width: 27px; height: 27px; }
  .lang a { padding: 4px 8px; font-size: 11.5px; }
  .burger { width: 36px; height: 34px; padding: 0 7px; }
}

/* Narrow phones: keep every header control on one row with the bigger logo. */
@media (max-width: 400px) {
  .container { padding-inline: 10px; }
  .logo img { height: 30px; }
  .header__tools { gap: 4px; }
  .icon-btn { width: 32px; height: 32px; }
  .icon-btn img { width: 25px; height: 25px; }
  .lang a { padding: 4px 6px; font-size: 11px; }
  .burger { width: 32px; height: 32px; padding: 0 6px; }
}

@media (min-width: 1240px) {
  .header__navbar { display: block; }
  .burger, .mobile-nav { display: none !important; }
  .header__phone { display: inline-flex; }
  .header__phone-icon { display: none; }
  .header__tools { gap: 12px; }
  .logo img { height: 42px; }
}

/* ==========================================================================
   First screen
   ========================================================================== */
.hero { background: var(--bg-tint); padding: 34px 0 30px; text-align: center; }
.hero h1 { margin-bottom: .4em; }
.hero p { max-width: 760px; margin: 0 auto; font-size: clamp(1rem, 2vw, 1.15rem); color: var(--text); }

/* Big visual banner (pre-rendered image) --------------------------------- */
.banner { padding: 0 0 28px; background: var(--bg-tint); }
.banner picture { display: block; }
.banner__link {
  display: block; max-width: 1000px; margin-inline: auto;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.banner__link:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.banner__link:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.banner img { width: 100%; height: auto; }
@media (max-width: 768px) {
  .banner { padding-bottom: 20px; }
  .banner__link { max-width: 520px; }
}

/* Home banner built in markup ---------------------------------------------
   The TZ asks for the style of the inner-page banners: white-and-green, soft
   waves, medical decoration, a real photo, big heading, short text, benefits. */
/* The first screen and the visual block share one surface, so no seam shows
   where the two sections meet. */
.intro {
  position: relative; overflow: hidden;
  background:
    radial-gradient(90% 60% at 88% 62%, #E3F4E9 0%, rgba(227, 244, 233, 0) 70%),
    linear-gradient(180deg, var(--bg-tint) 0%, #EFF8F2 58%, #F7FCF9 100%);
}
.intro .hero { background: transparent; }

.promo { position: relative; padding: 40px 0 64px; background: transparent; }
.promo__blob { position: absolute; border-radius: 50%; pointer-events: none; z-index: 0; }
.promo__blob--a {
  width: 320px; height: 320px; top: 40px; left: -120px;
  background: radial-gradient(circle, rgba(22, 163, 74, .10) 0%, rgba(22, 163, 74, 0) 70%);
}
.promo__blob--b {
  width: 420px; height: 420px; right: -140px; bottom: -160px;
  background: radial-gradient(circle, rgba(7, 94, 59, .09) 0%, rgba(7, 94, 59, 0) 70%);
}
.promo .container { position: relative; z-index: 1; }

.promo__wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 60px; z-index: 1; }

.promo__grid { display: grid; gap: 28px; align-items: center; }
.promo__h1 { font-size: clamp(1.65rem, 4.3vw, 2.6rem); margin-bottom: .35em; }
.promo__lead { color: var(--text); max-width: 560px; font-size: 1.1rem; margin-bottom: 0; }

.promo__benefits { display: grid; gap: 12px; grid-template-columns: 1fr; list-style: none; margin: 26px 0 0; padding: 0; }
.promo__benefits li {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; font-weight: 600; color: var(--green-dark);
  box-shadow: var(--shadow); line-height: 1.35;
}
.promo__icon {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-chip); color: var(--green);
}
.promo__icon svg { width: 24px; height: 24px; }

.promo__media { margin: 0; }
.promo__media-link {
  display: block; border-radius: 20px; overflow: hidden;
  box-shadow: 0 18px 40px rgba(7, 94, 59, .16);
  transition: transform .2s ease, box-shadow .2s ease;
}
.promo__media-link:hover { transform: translateY(-3px); box-shadow: 0 22px 50px rgba(7, 94, 59, .22); }
.promo__media-link:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.promo__media img { width: 100%; }

@media (min-width: 720px) {
  .promo__benefits { grid-template-columns: repeat(3, 1fr); }
  .promo__benefits li { flex-direction: column; text-align: center; gap: 10px; padding: 18px 14px; }
}
@media (min-width: 960px) {
  .promo { padding: 52px 0 76px; }
  .promo__grid { grid-template-columns: 1.05fr .95fr; gap: 46px; }
  .promo__benefits { grid-template-columns: repeat(3, 1fr); margin-top: 30px; }
  .promo__media-link { max-width: 460px; margin-inline: auto; }
  .promo__wave { height: 80px; }
}

/* ==========================================================================
   Service cards (home)
   ========================================================================== */
.cards { display: grid; gap: 16px; grid-template-columns: 1fr; }
.card {
  display: flex; flex-direction: column; gap: 10px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 18px; color: inherit; transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: #c9e6d5; color: inherit; }
.card img { width: 68px; height: 68px; }
.card h3 { margin: 0; font-size: 1.08rem; }
.card p { margin: 0; color: var(--text-muted); font-size: .93rem; flex: 1 1 auto; }
.card__more { color: var(--green); font-weight: 600; font-size: .93rem; }
.card__more::after { content: " \2192"; }

@media (min-width: 560px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(4, 1fr); } }

/* ==========================================================================
   Catalog of certificates (medichna-dovidka)
   ========================================================================== */
.catalog { display: flex; flex-direction: column; gap: 26px; }
.catalog__cat-title {
  background: var(--bg-chip); color: var(--green-dark);
  font-size: 1.02rem; font-weight: 700; border-radius: var(--radius-sm);
  padding: 11px 18px; margin: 0 0 12px;
}
.catalog__list { display: flex; flex-direction: column; gap: 8px; }

.row, .acc > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 15px 18px; min-height: 72px;
}
.row__name, .acc__name { font-size: .97rem; line-height: 1.4; }
.row__price, .acc__price {
  color: var(--green); font-weight: 700; font-size: 1.12rem;
  white-space: nowrap; text-align: right; flex: 0 0 auto;
}

.acc { border-radius: var(--radius-sm); }
.acc > summary { cursor: pointer; list-style: none; }
.acc > summary::-webkit-details-marker { display: none; }
.acc__label { display: flex; flex-direction: column; gap: 2px; }
.acc__count { color: var(--text-muted); font-size: .84rem; }
.acc__right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.acc__arrow {
  width: 20px; height: 20px; flex: 0 0 auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316A34A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center/20px no-repeat;
  transition: transform .2s ease;
}
.acc[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.acc[open] .acc__arrow { transform: rotate(180deg); }
.acc__body {
  background: var(--bg-tint); border: 1px solid var(--border); border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 6px 18px 12px;
}
.acc__body .opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: .95rem;
}
.acc__body .opt:last-child { border-bottom: 0; }
.acc__body .opt b { color: var(--green); white-space: nowrap; }

@media (max-width: 520px) {
  .row, .acc > summary { flex-direction: column; align-items: flex-start; gap: 6px; }
  .acc__right { align-self: stretch; justify-content: space-between; }
  .row__price, .acc__price { text-align: left; }
}

/* Help block ------------------------------------------------------------- */
.help {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 22px; text-align: center; box-shadow: var(--shadow);
}
.help h2 { margin-bottom: .35em; }
.help p { color: var(--text-muted); max-width: 640px; margin: 0 auto 18px; }

/* ==========================================================================
   Price table (086)
   ========================================================================== */
.price-list { display: flex; flex-direction: column; gap: 8px; }
.price-list__head {
  display: none; padding: 0 18px 4px; color: var(--text-muted);
  font-size: .85rem; text-transform: uppercase; letter-spacing: .04em;
}
@media (min-width: 700px) {
  .price-list__head { display: flex; justify-content: space-between; }
}

/* ==========================================================================
   Reviews carousel
   ========================================================================== */
.slider { position: relative; }
.slider__viewport { position: relative; }

.slider__track {
  display: flex; gap: 16px; overflow-x: auto; padding: 4px 0 8px;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none;
}
.slider__track::-webkit-scrollbar { display: none; }

/* Cards fill the row: one on phones, two on tablets, three on desktop. */
.slider__slide {
  flex: 0 0 100%; margin: 0; scroll-snap-align: start;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px; box-shadow: var(--shadow); cursor: zoom-in;
}
.slider__slide img {
  width: 100%; height: 420px; object-fit: cover; object-position: top;
  border-radius: var(--radius-sm);
}
@media (min-width: 620px) {
  .slider__slide { flex-basis: calc((100% - 16px) / 2); }
  .slider__slide img { height: 440px; }
}
@media (min-width: 960px) {
  .slider__slide { flex-basis: calc((100% - 32px) / 3); }
  .slider__slide img { height: 460px; }
}

.slider__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0 0 3px;
  border: 1px solid var(--border); border-radius: 50%;
  background: rgba(255, 255, 255, .94); color: var(--green-dark);
  font-size: 26px; line-height: 1; cursor: pointer;
  box-shadow: var(--shadow-hover); transition: background .18s ease, opacity .18s ease;
}
.slider__arrow:hover { background: var(--bg-chip); }
.slider__arrow--prev { left: 6px; }
.slider__arrow--next { right: 6px; }
.slider__arrow[disabled] { opacity: .3; cursor: default; box-shadow: none; }
.slider__arrow[disabled]:hover { background: rgba(255, 255, 255, .94); }

.slider__dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.slider__dots button {
  width: 10px; height: 10px; padding: 0; border: 0; border-radius: 999px;
  background: #C6E0CF; cursor: pointer; transition: width .2s ease, background .2s ease;
}
.slider__dots button:hover { background: #9ACDAF; }
.slider__dots button[aria-current="true"] { width: 26px; background: var(--green); }

.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(7, 39, 25, .82);
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; width: auto; border-radius: var(--radius-sm); }
.lightbox__close {
  position: absolute; top: 14px; right: 16px; width: 44px; height: 44px;
  border-radius: 50%; border: 0; background: #fff; color: var(--green-dark);
  font-size: 24px; line-height: 1; cursor: pointer;
}

/* ==========================================================================
   Form
   ========================================================================== */
#form {
  scroll-margin-top: 130px;
  padding: 64px 0 54px;
}
@media (min-width: 1240px) {
  #form {
    scroll-margin-top: 170px;
  }
}

.form-card {
  scroll-margin-top: 130px;
}
@media (min-width: 1240px) {
  .form-card {
    scroll-margin-top: 170px;
  }
}

.form-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 20px; max-width: 620px; margin-inline: auto; box-shadow: var(--shadow);
}
.form-card h2 { text-align: center; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: .9rem; font-weight: 600; color: var(--text); }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
.field textarea { min-height: 96px; resize: vertical; }
.field--error input, .field--error textarea { border-color: #d13b3b; }
.field__error { display: none; margin-top: 5px; font-size: .82rem; color: #d13b3b; }
.field--error .field__error { display: block; }
.form-note { margin: 12px 0 0; font-size: .82rem; color: var(--text-muted); text-align: center; }
.form-success {
  display: none; margin-top: 16px; padding: 14px 16px; text-align: center;
  background: var(--bg-chip); border: 1px solid #bfe3cd; border-radius: var(--radius-sm);
  color: var(--green-dark); font-weight: 600;
}
.form-success.is-visible { display: block; }

/* ==========================================================================
   SEO text blocks
   ========================================================================== */
.seo { padding: 40px 0; }
.seo--tint { background: var(--bg-tint); }
.seo__head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.seo__head img { width: 62px; height: 62px; flex: 0 0 auto; }
.seo__head h2 { margin: 0; }
.seo__body { max-width: 900px; }
.seo__body p:last-child { margin-bottom: 0; }
.seo__body ul { color: var(--text); }

.benefits { display: grid; gap: 16px; grid-template-columns: 1fr; margin: 0 0 22px; }
.benefits img { border-radius: var(--radius); width: 100%; }
@media (min-width: 700px) { .benefits { grid-template-columns: repeat(3, 1fr); } }

@media (min-width: 700px) {
  .seo__head img { width: 76px; height: 76px; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { background: var(--green-dark); color: #fff; padding: 38px 0 20px; }
.footer a { color: #fff; }
.footer a:hover { color: #A7E0BE; }
.footer__grid { display: grid; gap: 26px; grid-template-columns: 1fr; }
.footer__logo { background: #fff; border-radius: var(--radius-sm); padding: 10px 12px; display: inline-block; }
.footer__logo img { height: 40px; width: auto; }
.footer h3 { color: #fff; font-size: 1.05rem; margin-bottom: .6em; }
.footer__tagline { font-weight: 700; margin: 14px 0 6px; }
.footer p, .footer li { color: var(--footer-muted); }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer__contacts p { margin-bottom: .5em; }
.footer__contact-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.footer__contact-link img { width: 24px; height: 24px; }
.footer__bottom { border-top: 1px solid rgba(255, 255, 255, .22); margin-top: 26px; padding-top: 16px; }
.footer__bottom p { margin: 0 0 8px; }
.footer__disclaimer { font-size: .8rem; line-height: 1.55; color: var(--footer-muted); }

.footer summary h3 { display: inline; }
.footer details > summary { cursor: pointer; list-style: none; }
.footer details > summary::-webkit-details-marker { display: none; }
.footer details > summary::after { content: " \2304"; }
.footer details[open] > summary::after { content: " \2303"; }

@media (min-width: 760px) {
  .footer__grid { grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; }
  .footer details > summary { pointer-events: none; }
  .footer details > summary::after { content: ""; }
}
