/* «Doctorly для клиник» — /clinics (SPEC-site-requests, 3): форма заявки клиники. Поверх site.css; тёмная тема — по
   настройке системы, только на этой странице (body.clinics-page). Подписи полей и кнопки не переносятся. */

.clinics-page { color-scheme: light; }
.clinics { display: grid; place-items: center; }
.clinics__card {
  position: relative; width: min(720px, 100%); padding: 56px; border-radius: 36px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden;
}
.clinics__card::before {
  content: ""; position: absolute; inset: -40% -30% auto auto; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(104,195,120,.2), transparent 65%); pointer-events: none;
}
.clinics__card > * { position: relative; }
.clinics__eyebrow {
  display: inline-block; margin-bottom: 16px; padding: 6px 14px; border-radius: 999px; background: var(--mint-50);
  color: var(--green-800); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.clinics__card h1 { font-size: clamp(30px, 4.4vw, 44px); letter-spacing: -.035em; margin-bottom: 16px; }
.clinics__lead { color: var(--muted); font-size: 18px; line-height: 1.55; margin-bottom: 36px; }
.nowrap { white-space: nowrap; }

.clinics__form { display: grid; gap: 18px; }
.clinics__form[hidden] { display: none; }
.clinics__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cfield { display: grid; gap: 6px; min-width: 0; align-content: start; }
.cfield label { display: flex; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; }
.cfield__optional { color: var(--soft); font-weight: 400; font-size: 13px; }
.cfield input, .cfield textarea {
  width: 100%; min-width: 0; border: 1px solid rgba(20, 33, 28, .16); border-radius: 14px; background: #fff;
  color: var(--ink); font: 400 16px/1.4 var(--font); transition: border-color .2s, box-shadow .2s;
}
.cfield input { height: 52px; padding: 0 16px; }
.cfield textarea { padding: 14px 16px; resize: vertical; min-height: 104px; }
.cfield input:focus, .cfield textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(104,195,120,.18); }
.cfield input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 4px rgba(231,77,63,.12); }
.cfield__error { font-size: 13px; color: var(--red); white-space: nowrap; }
.cfield__error[hidden] { display: none; }
.clinics__hint { margin-top: -8px; font-size: 13px; color: var(--soft); }

/* Ловушка для ботов: вне экрана, не display:none — иначе её пропускают и боты. */
.clinics__trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.ccheck { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; margin-top: 4px; font-size: 15px; line-height: 1.45; color: var(--text); cursor: pointer; }
.ccheck input {
  appearance: none; -webkit-appearance: none; width: 24px; height: 24px; margin: 0; border-radius: 7px;
  border: 1.5px solid rgba(20, 33, 28, .3); background: #fff; display: grid; place-items: center; cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.ccheck input::after {
  content: ""; width: 10px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px;
  transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .2s var(--ease);
}
.ccheck input:checked { background: var(--green-800); border-color: var(--green-800); }
.ccheck input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.ccheck input:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.ccheck.is-invalid input { border-color: var(--red); box-shadow: 0 0 0 4px rgba(231,77,63,.12); }
.ccheck a { color: var(--green-700); }

.clinics__error { padding: 12px 16px; border-radius: 14px; background: rgba(231,77,63,.08); color: #B3261E; font-size: 15px; }
.clinics__error[hidden] { display: none; }

.clinics__submit { justify-self: start; height: 56px; padding: 0 32px; gap: 10px; font-size: 16px; white-space: nowrap; }
.clinics__submit:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.clinics__spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: clinics-spin .8s linear infinite; }
.is-busy .clinics__spinner { display: block; }
@keyframes clinics-spin { to { transform: rotate(360deg); } }

.clinics__done { display: grid; justify-items: start; gap: 20px; padding-top: 4px; outline: none; }
.clinics__done[hidden] { display: none; }
.clinics__done-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--mint-50); }
.clinics__done-icon svg { width: 28px; height: 28px; fill: var(--green-800); }
.clinics__done-text { font-size: 20px; line-height: 1.5; color: var(--ink); font-weight: 500; }

@media (max-width: 560px) {
  .clinics__card { padding: 32px 20px; border-radius: 28px; }
  .clinics__lead { font-size: 16px; margin-bottom: 28px; }
  .clinics__row { grid-template-columns: 1fr; }
  .clinics__submit { justify-self: stretch; }
  .clinics__done .btn { justify-self: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .clinics__spinner { animation: none; }
  .ccheck input::after { transition: none; }
}

/* ---------- тёмная тема ---------- */
@media (prefers-color-scheme: dark) {
  .clinics-page {
    color-scheme: dark;
    --ink: #F2F7F4; --text: #D3DDD8; --muted: #A3B1AB; --soft: #84928C;
    --bg: #0B1713; --surface: #12241D; --line: rgba(255, 255, 255, .1); --mint-50: rgba(104, 195, 120, .14);
    --green-700: #7FD394; --green-800: #4DB572;
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 40px 80px -24px rgba(0, 0, 0, .6);
  }
  .clinics-page .nav.is-scrolled { background: rgba(11, 23, 19, .78); }
  .clinics-page .btn--dark { background: #F2F7F4; color: #0B1713; }
  .clinics-page .btn--dark:hover { background: #fff; color: #0B1713; }
  .clinics-page .btn--ghost { color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24); }
  .clinics-page .btn--ghost:hover { background: rgba(255, 255, 255, .06); color: var(--ink); }
  .clinics-page .footer { background: #0E1C17; }
  .clinics-page .footer__col a:hover { color: var(--green-700); }
  .clinics-page .clinics__card::before { background: radial-gradient(circle, rgba(104,195,120,.14), transparent 65%); }
  .clinics-page .clinics__eyebrow { color: #9FE3B1; }
  .clinics-page .cfield input, .clinics-page .cfield textarea { background: #0E1C17; border-color: rgba(255, 255, 255, .16); }
  .clinics-page .ccheck input { background: #0E1C17; border-color: rgba(255, 255, 255, .35); }
  .clinics-page .clinics__error { background: rgba(231,77,63,.14); color: #FF8A80; }
  .clinics-page .cfield__error { color: #FF8A80; }
  .clinics-page .clinics__spinner { border-color: rgba(11,23,19,.25); border-top-color: #0B1713; }
}
