/* Общие стили сайта uslugi-yurista-online.ru: шапка, меню, кнопки, подвал, индикатор рабочего времени.
   Подключается на всех страницах. Стили конкретной страницы лежат в самой странице. */

:root {
  --bg: #f2f5fb;
  --white: #ffffff;
  --ink: #0e1b3d;
  --muted: #5a6784;
  --blue: #0d4cd3;
  --blue-dark: #0a3aa6;
  --blue-soft: #e4ecfc;
  --rule: #d8e1f2;
  --radius: 16px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- шапка (одинаковая на всех страницах, остаётся на экране при прокрутке) ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--rule);
}
.top .bar { display: flex; align-items: center; gap: 12px; min-height: 68px; }
.brand {
  margin-right: auto;
  min-width: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
  text-decoration: none;
  color: var(--blue);
}
.nav { display: none; gap: 2px; margin-right: 12px; }
.nav a { padding: 8px 12px; border-radius: 8px; font-size: 15px; text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--blue); background: var(--blue-soft); }

/* пара кнопок связи в шапке: Telegram и почта */
.top-actions { display: flex; flex: none; gap: 8px; }

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 10px;
  cursor: pointer;
}
.menu-btn svg { width: 22px; height: 22px; }
.js .menu-btn { display: inline-flex; }

.mobile-nav { border-top: 1px solid var(--rule); background: #fff; }
.js .mobile-nav { display: none; }
.js .mobile-nav.open { display: block; }
.mobile-nav a {
  display: block;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
  font-size: 17px;
  text-decoration: none;
  color: var(--ink);
}
.mobile-nav a:last-child { border-bottom: 0; }
.mobile-nav a:hover { background: var(--blue-soft); color: var(--blue); }

/* подписи кнопок в шапке: на широком экране «Написать в Telegram» и «Почта»,
   на среднем «Написать» и «Почта», на телефоне только значки (самолётик и конверт) */
.btn-small .long { display: none; }
@media (min-width: 1000px) { .btn-small .long { display: inline; } }
@media (min-width: 900px) {
  .nav { display: flex; }
  .mobile-nav, .js .mobile-nav.open { display: none; }
  .js .menu-btn { display: none; }
}
@media (max-width: 640px) {
  .top .btn-small { width: 44px; padding: 0; }
  .top .btn-small .label { display: none; }
}
@media (max-width: 520px) {
  .brand { font-size: 16px; }
}

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 26px;
  background: var(--blue);
  color: #fff;
  font: 600 16px/1.2 var(--font);
  text-decoration: none;
  border-radius: 12px;
  border: 2px solid var(--blue);
  transition: background .15s;
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-small { min-height: 44px; padding: 8px 16px; font-size: 15px; border-radius: 10px; gap: 8px; }
.btn-light { background: #fff; color: var(--blue); border-color: #fff; }
.btn-light:hover { background: var(--blue-soft); border-color: var(--blue-soft); }
/* вторая кнопка пары (почта): контурная на светлом фоне */
.btn-outline { background: transparent; color: var(--blue); }
.btn-outline:hover { background: var(--blue-soft); border-color: var(--blue-dark); color: var(--blue-dark); }
/* вторая кнопка пары на синей полосе: белый контур */
.btn-outline-light { background: transparent; color: #fff; border-color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, .16); border-color: #fff; }

/* адрес почты текстом: выделяется целиком одним нажатием, чтобы его было легко скопировать */
.mail-line { margin: 14px 0 0; font-size: 15px; color: var(--muted); }
.mail-addr { -webkit-user-select: all; user-select: all; white-space: nowrap; color: var(--ink); }

/* ---------- нижняя синяя полоса ---------- */
.cta { background: var(--blue); color: #fff; padding: 48px 0; border-top: 0; }
.cta .wrap { display: grid; gap: 20px; }
.cta h2 { color: #fff; font-size: clamp(24px, 3.4vw, 32px); line-height: 1.2; margin: 0 0 8px; }
.cta p { margin: 0; color: #d4e0fb; }
.cta-actions { display: grid; gap: 12px; }
@media (min-width: 800px) {
  .cta .wrap { grid-template-columns: 1.4fr auto; align-items: center; gap: 48px; }
}

/* ---------- подвал (одинаковый на всех страницах) ---------- */
.foot { padding: 32px 0 44px; font-size: 15px; color: var(--muted); border-top: 1px solid var(--rule); }
.foot-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; margin-bottom: 18px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot-nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.foot-nav a:hover { color: var(--blue); text-decoration: underline; }
.foot p { margin: 0 0 10px; max-width: 60em; }

/* ---------- индикатор рабочего времени (слово «работаю» с лампочкой) ---------- */
.wt-wrap { position: relative; display: inline-block; }
.wt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 1px dotted var(--muted);
  cursor: help;
}
.wt-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #aab3c8;
  transition: background .2s, box-shadow .2s;
}
.is-on .wt-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .25), 0 0 10px 2px rgba(34, 197, 94, .75);
  animation: wt-pulse 2.4s ease-in-out infinite;
}
@keyframes wt-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, .25), 0 0 10px 2px rgba(34, 197, 94, .75); }
  50% { box-shadow: 0 0 0 5px rgba(34, 197, 94, .12), 0 0 14px 4px rgba(34, 197, 94, .55); }
}
@media (prefers-reduced-motion: reduce) { .is-on .wt-dot { animation: none; } }
.wt-tip {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: min(300px, 78vw);
  padding: 12px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(14, 27, 61, .25);
}
.wt-tip[hidden] { display: none; }
/* блок «Рабочее время» перед синей полосой (одинаковый на всех страницах) */
.hours { padding: 56px 0; background: var(--white); border-top: 1px solid var(--rule); }
.hours h2 { font-size: clamp(26px, 3.6vw, 36px); line-height: 1.15; letter-spacing: -.015em; margin: 0 0 20px; }
.hours-panel {
  max-width: 44em;
  padding: 24px 28px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
@media (max-width: 520px) { .hours-panel { padding: 20px; } }
.hours-text { margin: 0; font-size: 16px; line-height: 1.6; color: var(--muted); }
.wt-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 21px;
  line-height: 1.3;
  color: var(--ink);
}
.wt-status[hidden] { display: none; }
.wt-status .wt-dot { width: 14px; height: 14px; }
/* если года нет в календаре, индикатор не показываем: слово остаётся обычным текстом */
.wt-wrap.unknown .wt { border-bottom: 0; cursor: text; font-weight: inherit; }
.wt-wrap.unknown .wt-dot { display: none; }

/* ---------- обратная связь ---------- */
.contact-section { padding: 56px 0; background: var(--bg); border-top: 1px solid var(--rule); }
.contact-layout { display: grid; gap: 28px 48px; align-items: start; }
.contact-intro h2 { font-size: clamp(26px, 3.6vw, 36px); line-height: 1.2; margin: 0 0 16px; letter-spacing: -.015em; }
.contact-intro p { margin: 0 0 14px; color: var(--muted); }
.contact-intro .contact-note { font-size: 15px; }
.contact-form { min-width: 0; padding: 28px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--white); }
.contact-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.contact-fields { display: grid; gap: 18px; }
.contact-field { display: grid; gap: 6px; min-width: 0; }
.contact-field label { font-size: 16px; font-weight: 600; color: var(--ink); }
.contact-optional { font-weight: 400; font-size: 14px; color: var(--muted); }
.contact-form input:not([type="checkbox"]):not([type="hidden"]), .contact-form textarea {
  width: 100%; min-width: 0; border: 1px solid #8795af; border-radius: 9px; padding: 12px 14px;
  color: var(--ink); background: #fff; font: 400 16px/1.5 var(--font);
}
.contact-form textarea { min-height: 130px; resize: vertical; }
.contact-form [aria-invalid="true"] { border-color: #a51e32 !important; }
.contact-help, .contact-policy { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.contact-error { font-size: 14px; color: #a51e32; }
.contact-error:empty { display: none; }
.contact-consent { margin: 22px 0 12px; }
.contact-consent label { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.5; cursor: pointer; }
.contact-consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--blue); }
.contact-form .contact-policy { margin: 0 0 20px; }
.contact-form .btn { width: 100%; cursor: pointer; }
.contact-form .btn:disabled { cursor: wait; opacity: .65; }
.contact-status { padding: 16px; margin: 18px 0 0; border-radius: 9px; background: #e5f4ea; color: #18572e; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.contact-status.is-error { color: #812030; background: #fff0f2; }
.contact-status[hidden], .contact-form fieldset[hidden] { display: none; }
.contact-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-noscript { color: #812030; }
.legal-page { padding-top: 40px; padding-bottom: 56px; max-width: 860px; }
.legal-page h1 { font-size: clamp(27px, 4vw, 38px); line-height: 1.2; }
.legal-page h2 { font-size: 23px; line-height: 1.3; margin-top: 32px; }
@media (min-width: 900px) { .contact-layout { grid-template-columns: 0.85fr 1.15fr; } }
@media (max-width: 520px) { .contact-form { padding: 20px; } .contact-section { padding: 40px 0; } }
