/* ============================================
   Office Law - Modern Legal Website
   Color Palette: Dark navy, light blue-gray, white
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1a2a3a;
  --primary-light: #2c3e50;
  --accent: #3a7bd5;
  --accent-hover: #2a5db0;
  --bg-light: #f2f7fa;
  --bg-white: #ffffff;
  --text-dark: #1a1a1a;
  --text-muted: #5a6a7a;
  --text-light: #ffffff;
  --border: #e1e8ed;
  --shadow: 0 2px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --transition: 0.3s ease;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-dark);
  background: var(--bg-white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--accent-hover);
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Language Toggle System */
.lang-en { display: none; }
.lang-ru { display: inline; }
body.en .lang-en { display: inline; }
body.en .lang-ru { display: none; }

/* Block-level language elements */
div.lang-en, section.lang-en, p.lang-en, li.lang-en, ul.lang-en, h1.lang-en, h2.lang-en, h3.lang-en, h4.lang-en, article.lang-en {
  display: none;
}
div.lang-ru, section.lang-ru, p.lang-ru, li.lang-ru, ul.lang-ru, h1.lang-ru, h2.lang-ru, h3.lang-ru, h4.lang-ru, article.lang-ru {
  display: block;
}
body.en div.lang-en, body.en section.lang-en, body.en p.lang-en, body.en li.lang-en, body.en ul.lang-en, body.en h1.lang-en, body.en h2.lang-en, body.en h3.lang-en, body.en h4.lang-en, body.en article.lang-en {
  display: block;
}
body.en div.lang-ru, body.en section.lang-ru, body.en p.lang-ru, body.en li.lang-ru, body.en ul.lang-ru, body.en h1.lang-ru, body.en h2.lang-ru, body.en h3.lang-ru, body.en h4.lang-ru, body.en article.lang-ru {
  display: none;
}

/* For flex containers */
.services-grid .lang-en, .features-grid .lang-en, .news-grid .lang-en {
  display: none;
}
body.en .services-grid .lang-en, body.en .features-grid .lang-en, body.en .news-grid .lang-en {
  display: flex;
}
body.en .services-grid .lang-ru, body.en .features-grid .lang-ru, body.en .news-grid .lang-ru {
  display: none;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.header.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.logo img {
  height: 44px;
  width: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.logo-text {
  line-height: 1.2;
}

.logo-text small {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.logo-text small.lang-en {
  display: none;
}
body.en .logo-text small.lang-en {
  display: block;
}
body.en .logo-text small.lang-ru {
  display: none;
}

/* Main Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a {
  color: var(--text-dark);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav a:hover {
  background: var(--bg-light);
  color: var(--accent);
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dropdown-toggle::after {
  content: '';
  border: solid var(--text-muted);
  border-width: 0 1.5px 1.5px 0;
  display: inline-block;
  padding: 2.5px;
  transform: rotate(45deg);
  margin-top: -2px;
  transition: transform var(--transition);
}

.dropdown:hover .dropdown-toggle::after {
  transform: rotate(-135deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  border: 1px solid var(--border);
  padding: 8px;
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--transition);
  z-index: 100;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
}

.dropdown-menu a:hover {
  background: var(--bg-light);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-phone {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.lang-switch {
  display: flex;
  background: var(--bg-light);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.lang-switch button {
  padding: 6px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
}

.lang-switch button.active {
  background: var(--accent);
  color: white;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  padding: 140px 0 80px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--text-light);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(58,123,213,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  max-width: 700px;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.85;
  max-width: 600px;
  margin-bottom: 32px;
  line-height: 1.7;
}

/* Inner page hero — reduced height */
.hero.hero-small {
  padding: 110px 0 48px;
}

.hero.hero-small h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.hero.hero-small p {
  font-size: 1rem;
  margin-bottom: 0;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(58,123,213,0.4);
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
  color: white;
}

.btn-dark {
  background: var(--primary);
  color: white;
}

.btn-dark:hover {
  background: var(--primary-light);
  color: white;
  transform: translateY(-2px);
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
  padding: 80px 0;
}

.section-light {
  background: var(--bg-light);
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--primary);
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 48px;
  max-width: 600px;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header .section-title {
  margin-bottom: 12px;
}

.section-header .section-subtitle {
  margin: 0 auto;
}

/* ============================================
   SERVICE CARDS
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 32px 28px;
  border: 1px solid var(--border);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
  border-color: var(--accent);
}

.service-card .icon {
  width: 48px;
  height: 48px;
  background: var(--bg-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.service-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--primary);
}

.service-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.service-card .card-link {
  margin-top: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.service-card .card-link::after {
  content: '\2192';
  transition: transform var(--transition);
}

.service-card:hover .card-link::after {
  transform: translateX(4px);
}

/* ============================================
   FEATURES / BENEFITS
   ============================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}

.feature-card {
  text-align: center;
  padding: 32px 24px;
}

.feature-card .feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: var(--accent);
  color: white;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ============================================
   PAGE CONTENT
   ============================================ */
.page-hero {
  padding: 120px 0 60px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--text-light);
}

.page-hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.page-hero p {
  font-size: 1.05rem;
  opacity: 0.8;
  max-width: 600px;
}

.page-content {
  padding: 60px 0;
}

.page-content .main-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  margin: 40px 0 16px;
}

.page-content .main-content h2:first-child {
  margin-top: 0;
}

.page-content .main-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin: 32px 0 12px;
}

.page-content .main-content p {
  margin-bottom: 16px;
  color: var(--text-dark);
  line-height: 1.8;
}

.page-content .main-content ul {
  margin: 16px 0;
  padding-left: 24px;
}

.page-content .main-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 96px;
}

.sidebar-card {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 28px;
  border: 1px solid var(--border);
}

.sidebar-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--primary);
}

.sidebar-card ul {
  list-style: none;
  padding: 0;
}

.sidebar-card li {
  margin-bottom: 0;
}

.sidebar-card a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-dark);
  font-size: 0.9rem;
  transition: all var(--transition);
}

.sidebar-card a:hover,
.sidebar-card a.active {
  background: var(--accent);
  color: white;
}

/* ============================================
   ACCORDION (for service sub-sections)
   ============================================ */
.accordion {
  margin: 24px 0;
}

.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.accordion-header {
  padding: 20px 24px;
  background: var(--bg-white);
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition);
}

.accordion-header:hover {
  background: var(--bg-light);
}

button.accordion-header {
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
}

.accordion-icon {
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--accent);
  transition: transform var(--transition);
  flex-shrink: 0;
  line-height: 1;
}

.accordion-item.active .accordion-icon {
  transform: rotate(45deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.accordion-body-inner {
  padding: 0 24px 20px;
  color: var(--text-muted);
  line-height: 1.8;
}

.accordion-item.active .accordion-body {
  max-height: 1000px;
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  text-align: center;
}

.cta-section h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.cta-section p {
  opacity: 0.8;
  margin-bottom: 32px;
  font-size: 1.05rem;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-buttons .btn {
  min-width: 200px;
  justify-content: center;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.contact-info-item .icon {
  width: 48px;
  height: 48px;
  background: var(--bg-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.contact-info-item h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.contact-info-item p,
.contact-info-item a {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
}

.map-container {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  height: 400px;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Social links */
.social-links {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.social-link {
  width: 44px;
  height: 44px;
  background: var(--bg-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: all var(--transition);
  text-decoration: none;
}

.social-link:hover {
  background: var(--accent);
  color: white;
}

/* ============================================
   NEWS CARDS
   ============================================ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.news-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all var(--transition);
}

.news-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.news-card-body {
  padding: 28px;
}

.news-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-light);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}

.news-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--primary);
}

.news-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--primary);
  color: var(--text-light);
  padding: 60px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  opacity: 0.7;
  font-size: 0.9rem;
  margin-top: 12px;
  line-height: 1.6;
}

.footer h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  opacity: 0.5;
}

.footer .logo {
  color: var(--text-light);
}

.footer .logo-text small {
  color: rgba(255,255,255,0.5);
}

.footer .social-links {
  margin-top: 16px;
}

.footer .social-link {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
}

.footer .social-link:hover {
  background: var(--accent);
  color: white;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: var(--bg-white);
    flex-direction: column;
    align-items: stretch;
    padding: 80px 24px 24px;
    box-shadow: -5px 0 30px rgba(0,0,0,0.1);
    transition: right var(--transition);
    overflow-y: auto;
    z-index: 999;
    gap: 0;
  }

  .nav.open {
    right: 0;
  }

  .nav a {
    padding: 14px 16px;
    font-size: 1rem;
  }

  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0 0 0 16px;
    display: none;
  }

  .dropdown.open .dropdown-menu {
    display: block;
  }

  .menu-toggle {
    display: flex;
    z-index: 1001;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .header-phone {
    display: none;
  }

  .hero {
    padding: 120px 0 60px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .section {
    padding: 60px 0;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .hero.hero-small {
    padding: 100px 0 36px;
  }

  .hero.hero-small h1 {
    font-size: 1.7rem;
  }

  .page-hero h1 {
    font-size: 1.8rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .cta-section h2 {
    font-size: 1.6rem;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  /* Mobile nav overlay */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 998;
  }

  .nav-overlay.active {
    display: block;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.7rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Utility */
.text-center { text-align: center; }
.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }
.mt-48 { margin-top: 48px; }
.mb-48 { margin-bottom: 48px; }
