:root {
  --page-bg: #F8F6F0;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-text: #ffffff;
  --header-navy: #1A2B3C;
  --header-burgundy: #6b1c2d;
  --gold: #C9A227;
  --text-primary: #1A2B3C;
}

html {
  background-color: var(--page-bg);
}

.hidden {
  display: none !important;
}

body {
  background-color: transparent;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("/images/flag-bg.png") center / cover no-repeat fixed;
  opacity: 0.055;
  filter: saturate(0.18) brightness(1.85);
}

.site-logo {
  display: block;
  width: 2.5rem;
  height: auto;
  object-fit: contain;
}

.site-logo-sm {
  display: block;
  width: 1.125rem;
  height: auto;
  object-fit: contain;
}

.brand-title {
  display: block;
  min-width: 0;
  line-height: 1.2;
}

.brand-title-line1,
.brand-title-line2 {
  display: block;
}

.brand-title-break,
.phone-line-break {
  display: none;
}

.brand-title-line1 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.brand-title-line2 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

@media (min-width: 640px) {
  .brand-title-line1 {
    font-size: 0.75rem;
  }

  .brand-title-line2 {
    font-size: 1rem;
  }
}

.phone-line {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
}

.phone-line-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1.2;
}

.phone-line-number {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  line-height: 1.2;
}

.phone-line-number:hover {
  text-decoration: underline;
}

.phone-line--hero .phone-line-number {
  font-size: 1.25rem;
}

.phone-line--nav {
  align-items: flex-end;
  text-align: right;
}

.phone-line--compact .phone-line-number {
  font-size: 0.9375rem;
}

.phone-line--compact .phone-line-label {
  font-size: 0.625rem;
}

.site-nav-cta .phone-line--nav {
  width: 100%;
}

@media (min-width: 640px) {
  .site-nav-cta .phone-line--nav {
    width: auto;
  }
}

.duty-lawyers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.625rem;
}

@media (min-width: 480px) {
  .duty-lawyers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
}

@media (min-width: 768px) {
  .duty-lawyers-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.875rem;
  }
}

@media (min-width: 1280px) {
  .duty-lawyers-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.duty-lawyer-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.875rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  box-shadow: 0 4px 18px -14px rgba(26, 43, 60, 0.25);
}

.duty-lawyer-photo-wrap {
  position: relative;
  flex: 0 0 3.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  overflow: hidden;
  background: #e8e4dc;
  border: 2px solid rgba(26, 43, 60, 0.06);
}

.duty-lawyer-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.duty-lawyer-dot {
  position: absolute;
  right: 0.1rem;
  bottom: 0.1rem;
  width: 0.625rem;
  height: 0.625rem;
  box-shadow: 0 0 0 2px #fff;
}

.duty-lawyer-body {
  min-width: 0;
  flex: 1 1 auto;
  padding-top: 0.125rem;
}

.duty-lawyer-name {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

@media (min-width: 640px) {
  .duty-lawyer-name {
    font-size: 0.875rem;
  }
}

.duty-lawyer-rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #64748b;
}

.duty-lawyer-score {
  font-weight: 700;
  color: #334155;
}

.duty-lawyer-offline {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.online-status--sm {
  padding: 0.15rem 0.5rem 0.15rem 0.4rem;
}

.online-status--sm .online-status-dot {
  width: 0.4375rem;
  height: 0.4375rem;
}

.footer-legal {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-legal-copy,
.footer-legal-requisites {
  font-size: 0.75rem;
  line-height: 1.5;
  opacity: 0.75;
}

.footer-legal-requisites {
  margin-top: 0.35rem;
}

.service-link-phone .phone-line {
  align-items: flex-end;
}

.hero-flag-accent {
  position: absolute;
  top: 0;
  right: 0;
  width: min(52%, 560px);
  height: 100%;
  pointer-events: none;
  background: url("/images/flag-bg.png") center / cover no-repeat;
  opacity: 0.09;
  filter: saturate(0.15) brightness(1.9);
  -webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, 0.65) 0%, transparent 88%);
  mask-image: linear-gradient(to left, rgba(0, 0, 0, 0.65) 0%, transparent 88%);
}

@media (max-width: 1023px) {
  .hero-flag-accent {
    width: 100%;
    opacity: 0.05;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.35) 40%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.35) 40%, transparent 100%);
  }
}

.site-topbar {
  background-color: var(--header-navy);
  color: #fff;
}

.site-nav {
  background: #fff;
  border-bottom: 1px solid rgba(26, 43, 60, 0.08);
}

.site-nav-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  grid-template-areas:
    "brand"
    "cta"
    "nav";
  align-items: center;
}

.site-nav-brand {
  grid-area: brand;
  min-width: 0;
}

.site-nav-cta {
  grid-area: cta;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
}

.site-nav-links {
  grid-area: nav;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1.25rem;
  row-gap: 0.5rem;
}

@media (min-width: 768px) {
  .site-nav-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand cta"
      "nav nav";
    gap: 0.625rem 1rem;
  }

  .site-nav-cta {
    width: auto;
    align-items: flex-end;
  }

  .site-nav-links {
    padding-top: 0.25rem;
    border-top: 1px solid rgba(26, 43, 60, 0.08);
  }
}

@media (min-width: 1120px) {
  .site-nav-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
  }

  .site-nav-brand {
    flex: 0 1 auto;
    max-width: 17rem;
  }

  .site-nav-links {
    flex: 1 1 auto;
    justify-content: center;
    padding-top: 0;
    border-top: 0;
  }

  .site-nav-cta {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    width: auto;
  }

  .site-nav-cta .btn-accent {
    white-space: nowrap;
  }
}

.site-nav-links a {
  white-space: nowrap;
}

.phone-mask-input {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.btn-accent {
  background-color: var(--accent);
  color: var(--accent-text, #fff);
  border: 1px solid transparent;
}
.btn-accent:hover {
  background-color: var(--accent-hover);
  color: var(--accent-text, #fff);
}

.text-accent-link {
  color: var(--accent);
}
.text-accent-link:hover {
  color: var(--accent-hover);
}

.service-link,
#services .card-service a.service-link,
.card-service a.service-link {
  color: #2563eb !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  cursor: pointer;
}

.service-link:hover,
#services .card-service a.service-link:hover,
.card-service a.service-link:hover {
  color: #1d4ed8 !important;
}

.card-service h3 .service-link {
  font-size: 1.125rem;
  line-height: 1.4;
}

.card-service {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 246, 252, 0.96) 100%);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(26, 43, 60, 0.10);
  border: 1px solid rgba(201, 213, 226, 0.9);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-service:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(26, 43, 60, 0.14);
}

.badge-popular {
  background: rgba(201, 162, 39, 0.15);
  color: #9A7B1A;
}

.star-gold {
  color: var(--gold);
}

.hub-grid-3 {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .hub-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.hub-grid-zigzag {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hub-zigzag-item {
  display: grid;
  gap: 1rem;
  align-items: center;
}
@media (min-width: 768px) {
  .hub-zigzag-item {
    grid-template-columns: 1fr 1fr;
  }
  .hub-zigzag-item:nth-child(even) .hub-zigzag-text {
    order: 2;
  }
  .hub-zigzag-item:nth-child(even) .hub-zigzag-card {
    order: 1;
  }
}

.hub-masonry {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .hub-masonry {
    grid-template-columns: repeat(2, 1fr);
  }
  .hub-masonry .hub-featured {
    grid-column: span 2;
  }
}

.article-sidebar-layout {
  display: block;
}
@media (min-width: 1024px) {
  .article-sidebar-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    align-items: start;
  }
  .article-sidebar {
    position: sticky;
    top: 5.5rem;
  }
}

.article-insight {
  border-left-color: var(--accent) !important;
  background: rgba(165, 61, 77, 0.06) !important;
}

.article-toc a {
  color: var(--accent);
}

.article-form-block {
  border-color: rgba(165, 61, 77, 0.25) !important;
}

.reviews-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .reviews-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .reviews-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.review-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
  border-radius: 10px;
  box-shadow: 0 14px 32px rgba(26, 43, 60, 0.10);
  padding: 1.25rem;
  border: 1px solid rgba(201, 213, 226, 0.9);
}

.review-avatar {
  position: relative;
  display: inline-flex;
  height: 2.5rem;
  width: 2.5rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--header-navy);
  color: #fff;
}

.review-avatar--lg {
  height: 4rem;
  width: 4rem;
}

.review-user-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  height: 1.25rem;
  width: 1.25rem;
  opacity: 0.35;
}

.review-avatar--lg .review-user-icon {
  height: 1.75rem;
  width: 1.75rem;
}

.review-avatar-letter {
  position: relative;
  z-index: 1;
  font-size: 0.875rem;
  font-weight: 700;
}

.review-avatar--lg .review-avatar-letter {
  font-size: 1.25rem;
}

.review-card p {
  font-size: 0.875rem;
  line-height: 1.65;
}

#consult {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(240, 245, 251, 0.97) 100%);
  box-shadow: 0 20px 48px rgba(26, 43, 60, 0.14) !important;
}

#faq article {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 248, 253, 0.94) 100%);
  box-shadow: 0 12px 28px rgba(26, 43, 60, 0.08) !important;
}

.duty-lawyer-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(242, 247, 252, 0.96) 100%);
  box-shadow: 0 14px 32px rgba(26, 43, 60, 0.10) !important;
  border: 1px solid rgba(201, 213, 226, 0.9) !important;
}

.review-yandex img {
  display: block;
}

.card-service ul li a {
  display: inline;
  line-height: 1.5;
  color: #2563eb !important;
  text-decoration: underline !important;
}

.card-service h3 a {
  font-weight: 700;
  color: #2563eb !important;
  text-decoration: underline !important;
}

/* Mobile adaptations */
@media (max-width: 767px) {
  .site-nav-links {
    width: 100%;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(26, 43, 60, 0.08);
    justify-content: flex-start;
  }

  .site-nav-cta .btn-accent {
    width: 100%;
    justify-content: center;
    min-height: 2.75rem;
    font-size: 0.8125rem;
  }

  .site-nav-cta .phone-line--nav {
    align-items: center;
    text-align: center;
  }

  .brand-title-line1 {
    font-size: 0.6875rem;
  }

  .brand-title-line2 {
    font-size: 0.75rem;
  }

  .phone-line--hero {
    width: 100%;
  }

  .phone-line--hero .phone-line-number {
    font-size: 1.25rem;
  }

  .duty-lawyers-grid {
    gap: 0.5rem;
  }

  .duty-lawyer-card {
    padding: 0.5rem 0.625rem;
    gap: 0.625rem;
  }

  .duty-lawyer-photo-wrap {
    flex: 0 0 3rem;
    width: 3rem;
    height: 3rem;
  }

  .duty-lawyer-name {
    font-size: 0.75rem;
  }

  .duty-lawyer-rating {
    font-size: 0.6875rem;
  }

  .contacts-map-col {
    margin-top: 1.5rem;
  }

  .map-cities-list {
    gap: 0.375rem 0.5rem;
  }

  .map-city-chip {
    font-size: 0.6875rem;
    padding: 0.2rem 0.5rem;
  }

  #hero {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  #hero h1 {
    font-size: 1.625rem;
    line-height: 1.25;
  }

  #hero .btn-accent {
    width: 100%;
    justify-content: center;
  }

  #consult {
    scroll-margin-top: 5.5rem;
  }

  .lawyer-block .flex.items-start {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .lawyer-block .flex.items-start > div {
    width: 100%;
  }

  .services-grid-landing {
    grid-template-columns: 1fr;
  }

  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .card-service .mt-4.flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  main.article-main,
  .article-sidebar-layout {
    padding-bottom: 6rem;
  }

  .article-phone-contact {
    flex-direction: column;
    align-items: stretch;
  }

  .article-phone-contact a {
    width: 100%;
  }

  .hub-grid-3,
  .hub-masonry {
    grid-template-columns: 1fr;
  }

  .hub-masonry .hub-featured {
    grid-column: span 1;
  }

  .hub-zigzag-item {
    grid-template-columns: 1fr;
  }

  .hub-zigzag-item:nth-child(even) .hub-zigzag-text {
    order: 0;
  }

  #contacts .lg\\:grid {
    gap: 1.5rem;
  }

  .map-iframe,
  .russia-map-canvas {
    height: 260px;
  }
}

@media (min-width: 640px) and (max-width: 767px) {
  .services-grid-landing {
    grid-template-columns: repeat(2, 1fr);
  }
}

.services-grid-landing {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .services-grid-landing {
    grid-template-columns: repeat(3, 1fr);
  }
}

.hero-watermark {
  display: none;
}

.consult-form-header {
  padding-bottom: 0.25rem;
}

.consult-form-call-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.625rem;
}

@media (min-width: 480px) {
  .consult-form-call-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .consult-form-call-row .btn-accent {
    width: auto;
    min-width: 9rem;
  }
}

.lawyer-online-avatar {
  position: relative;
  flex-shrink: 0;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 1rem;
  overflow: hidden;
  background: #e8e4dc;
  border: 2px solid rgba(2, 132, 199, 0.15);
  box-shadow: 0 8px 24px -12px rgba(2, 132, 199, 0.25);
}

.lawyer-online-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.lawyer-online-avatar-icon {
  display: none;
}

.lawyer-online-dot {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  width: 0.875rem;
  height: 0.875rem;
  box-shadow: 0 0 0 3px #fff;
}

.hero-benefits .online-status-dot {
  width: 0.5rem;
  height: 0.5rem;
  flex-shrink: 0;
}

.hero-benefits .online-status-dot::after {
  inset: -2px;
}

@media (min-width: 640px) {
  .lawyer-online-avatar {
    width: 7rem;
    height: 7rem;
  }
}

.online-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.625rem 0.25rem 0.5rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.22);
}

.online-status-dot {
  position: relative;
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.online-status-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid rgba(16, 185, 129, 0.45);
  animation: online-pulse 2s ease-out infinite;
}

.online-status-text {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #047857;
}

@keyframes online-pulse {
  0% {
    transform: scale(0.85);
    opacity: 0.8;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.map-wrap {
  position: relative;
  min-height: 240px;
}

.map-iframe,
.russia-map-canvas {
  display: block;
  width: 100%;
  height: 300px;
  border: 0;
}

.russia-map-canvas {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 18px -14px rgba(26, 43, 60, 0.25);
  background: #e8eef4;
  overflow: hidden;
}

.contacts-layout {
  display: block;
}

.contacts-map-col {
  min-width: 0;
}

.map-cities-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.map-city-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.map-city-dot {
  flex: 0 0 0.5rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.lawyer-photo {
  display: block;
  width: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 1rem;
  border: 2px solid rgba(26, 43, 60, 0.08);
  background: #e8e4dc;
}

.lawyer-photo--section {
  width: 5.5rem;
  height: 5.5rem;
  max-width: 112px;
  max-height: 112px;
  aspect-ratio: 1 / 1;
  border-radius: 0.875rem;
  box-shadow: 0 8px 24px -12px rgba(26, 43, 60, 0.2);
}

@media (min-width: 640px) {
  .lawyer-photo--section {
    width: 7rem;
    height: 7rem;
  }
}

@media (min-width: 1024px) {
  .contacts-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
  }

  .map-iframe,
  .russia-map-canvas {
    height: 380px;
  }
}
