@import url('/css/tokens.css');

/* ============ BASE LAYOUT ============ */
html, body {
  height: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  background: var(--gray-bg);
  color: var(--text-light);
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

#scrollArea {
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 1;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
}

/* =========================
   SITE FOOTER
========================= */
.site-footer {
  position: relative;
  z-index: 5;
  display: block;
  /* Override generic footer mobile rules */
  padding: 24px 0 34px;
  padding-bottom: calc(34px + env(safe-area-inset-bottom));
  background: rgba(2, 6, 23, 0.72);
  border-top: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  line-height: 1.45;
  overflow: visible;
}

.site-footer * {
  box-sizing: border-box;
}

.site-footer .footer-bottom {
  min-height: 28px;
  align-items: center;
  padding-top: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  overflow: visible;
  line-height: 1.45;
}

.site-footer .footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-footer .footer-cols {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
}

.site-footer .footer-col {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  padding: 0 20px 0 0;
  margin-right: 4px;
}

.site-footer .footer-col:not(:last-child) {
  border-right: 1px solid rgba(255,255,255,0.15);
  padding-right: 20px;
  margin-right: 20px;
}

.site-footer .footer-title {
  display: none;
}

.site-footer a {
  color: rgba(255,255,255,0.76);
  text-decoration: none;
  font-size: 14px;
}

.site-footer a:hover {
  color: rgba(255,255,255,0.95);
  text-decoration: underline;
}

.site-footer .footer-bottom {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.site-footer .footer-sep { opacity: 0.6; margin: 0 8px; }

@media (max-width: 620px) {
  .site-footer .footer-cols { gap: 6px 0; }
  .site-footer .footer-col { padding-right: 12px; margin-right: 12px; gap: 4px 10px; }
}

/* Guides strip — single horizontal row below the main footer columns */
.site-footer .footer-guides-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.site-footer .footer-guides-label {
  color: rgba(255,255,255,0.92);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.02em;
  margin-right: 4px;
  white-space: nowrap;
}

.site-footer .footer-guides-row a {
  white-space: nowrap;
}

@media (max-width: 620px) {
  .site-footer .footer-guides-row {
    gap: 6px 14px;
  }
}


/* ============ HEADER ============ */
header.header-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
  z-index: 1000;
  background: #0d2f6e;
  border-bottom: 1px solid #FFB81C;
  /* Note: isolation:isolate removed — it caused modal overlays to render
     below the header in some Chrome versions. */
}

/* When any modal is open — lock header below the overlay so it can't be clicked */
body.modal-open header.header-container {
  z-index: 1 !important;
  pointer-events: none !important;
}

.header-container {
  box-sizing: border-box;
  display: flex;
  flex-wrap: nowrap;        /* header stays ONE row always */
  align-items: center;
  gap: 0 0.6rem;
  padding: 0.5rem 1.5rem;
}

/* Logo — left, never shrinks */
.header-container > .logo-link {
  flex: 0 0 auto;
}

/* Nav — fills middle, shrinks when viewport narrows; items wrap INSIDE */
.header-container > #mainMenu {
  flex: 1 1 0;
  min-width: 0;
  overflow: visible;
}

/* Controls (lang + theme) — right, never shrinks, never wraps */
.header-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Header logo size */
.logo-link img{
  height: 51px; /* reduced 2x from the previous 102px */
  width: auto;
  display: block;
}

.logo-text {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0d2f6e;
  -webkit-text-fill-color: #0d2f6e;
  line-height: 1;
  letter-spacing: 0.05em;
}

.logo-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f9b233;
  -webkit-text-fill-color: #f9b233;
  opacity: 1;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* ============ NAVIGATION ============ */
nav { 
  background: transparent; 
  padding: 0; 
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  align-items: center;
  justify-content: flex-end;
}

nav li {
  position: relative;
  padding: 0.4rem 0.7rem;
  color: var(--text-light);
  cursor: pointer;
  border-radius: 0;
  transition: color 0.18s;
  font-weight: 500;
  font-size: 1rem;
  white-space: nowrap;
  background: transparent;
  border: none;
}

nav li:hover {
  background: transparent;
  color: #fff;
  box-shadow: none;
}

/* ============ NAV DROPDOWN (How it works submenu) ============ */
.nav-dd { 
  position: relative;
  /* keep default li box model so height matches other menu items */
  display: list-item;
}

.nav-submenu {
  list-style: none;
  position: absolute;
  top: calc(100% - 2px); /* slight overlap so it doesn't "break" when moving cursor */
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 6px 6px; /* extra top padding creates a safe hover bridge */
  display: none;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: max-content;
  max-width: 300px;
  z-index: 50;

  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
}

/* Submenu opens on hover (and focus for keyboard) */
.nav-dd:hover .nav-submenu,
.nav-dd:focus-within .nav-submenu {
  display: flex;
}

.nav-submenu li {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  font-size: 0.95rem;
  white-space: nowrap;
  color: rgba(255,255,255,0.88);
}

.nav-submenu li a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.nav-submenu li:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.16);
  color: #fff;
}

.nav-dd-label {
  display: block;
  white-space: nowrap; /* keep "How it works" in one line */
  padding-right: 18px; /* space for caret */
}

.user-menu-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px 0 4px; /* caret space on right */
}

.user-menu-label::after {
  right: 4px;
}

.nav-logo-img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 50%;
}

.nav-logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}

/* caret indicator */
.nav-dd-label::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.85;
  font-size: 0.9rem;
}

.nav-dd:hover .nav-dd-label::after,
.nav-dd:focus-within .nav-dd-label::after {
  transform: translateY(-50%) rotate(180deg);
}

/* Keep dropdown within viewport on very small screens */
@media (max-width: 520px) {
  .nav-submenu {
    left: auto;
    right: 0;
    transform: none;
  }
}

/* ============ LANGUAGE SELECTOR - ФИНАЛЬНАЯ ВЕРСИЯ ============ */
.language-selector-container {
  margin-left: 0;
}

.language-selector {
  position: relative;
  display: flex;
  align-items: center;
  font-size: 1rem;
}

.language-dropdown {
  cursor: pointer;
  user-select: none;
  background: rgba(17,24,39,0.16);
  border-radius: 12px;
  padding: 0 1em;
  height: 36px;
  display: flex;
  align-items: center;
  position: relative;
  border: 1px solid rgba(56,189,248,0.13);
  min-width: 100px;
  box-sizing: border-box;
}

.language-current { 
  display: flex; 
  align-items: center; 
  gap: 0.3em; 
  width: 100%;
}

.language-arrow { 
  margin-left: auto; 
  font-size: 1.1em; 
  transition: transform 0.3s ease;
}

.language-dropdown.open .language-arrow {
  transform: rotate(180deg);
}

.language-name {
  flex: 1;
  font-size: 0.9em;
  font-weight: 500;
}

.language-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: max-content;
  min-width: 140px;
  background: #fff;
  color: #1e293b;
  box-shadow: 0 8px 24px rgba(17,24,39,0.15);
  border-radius: 10px;
  z-index: 5000;
  display: none;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.1);
}

.language-dropdown.open .language-options { 
  display: block; 
}

.language-option {
  display: flex; 
  align-items: center; 
  gap: 0.7em;
  padding: 0.6em 1em; 
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.95em;
  transition: background 0.16s;
  white-space: nowrap;
}

.language-option:last-child { 
  border-bottom: none; 
}

.language-option.selected, .language-option:hover {
  background: var(--gradient-btn); 
  color: #fff;
}

.language-option .language-name {
  font-size: 0.9em;
  font-weight: 500;
}

.language-dropdown:hover {
  background: rgba(17,24,39,0.25);
  border-color: rgba(56,189,248,0.2);
}

.language-options {
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.language-dropdown.open {
  background: rgba(17,24,39,0.25);
}

/* ============ HERO SECTION (WELCOME) ============ */

/* Стили для ECP элемента */
/* Улучшенные стили для hero-title */
.hero-title {
  display: inline-block;
  font-size: clamp(2.2rem, 7vw, 4.2rem);
  font-weight: 900;
  text-align: center;
  color: #e8f7ff;
  line-height: 1.13;
  letter-spacing: -0.015em;
  margin: 0 auto 1.6rem auto;
  white-space: nowrap;
  word-break: normal;
  max-width: 98vw;
  overflow: hidden; 
  text-overflow: ellipsis;
  padding: 0.34em 1.55em;
  border-radius: 2.3em;
  background: rgba(17,24,39,0.16);
  backdrop-filter: blur(8px) saturate(113%);
  -webkit-backdrop-filter: blur(8px) saturate(113%);
  box-shadow: 0 2px 14px 0 rgba(30,64,175,0.13);
  border: 2px solid rgba(56,189,248,0.11);
  text-shadow: 0 2px 12px rgba(13,19,39,0.11);
  transition: background 0.3s, box-shadow 0.3s;
  position: relative;
  z-index: 3;
}

.hero-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: url('/images/hero-eu-night.jpg') center center/cover no-repeat fixed;
  padding-top: 20px;
  box-sizing: border-box;
  text-align: center;
  overflow: hidden;
  z-index: 1;
  flex: 1;
}

/* Stars in default (dark) theme */
.hero-section::before {
  content: none;
}

.hero-section .hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(2,6,23,0.72) 0%, rgba(2,6,23,0.52) 45%, rgba(2,6,23,0.68) 100%);
  pointer-events: none;
  z-index: 2;
}

.hero-title, .hero-subtitle {
  position: relative; 
  z-index: 3; 
  box-sizing: border-box;
}

/* Стили только для блока ECP */




.hero-subtitle {
  max-width: 660px; 
  width: 100%;
  margin: 2.1rem auto 2.6rem auto;
  padding: 1.1em 2em 1.1em 2em;
  background: rgba(17,24,39,0.21);
  color: #e0eaff; 
  text-align: center;
  font-size: clamp(1.08rem, 2.2vw, 1.22rem);
  line-height: 1.48; 
  border-radius: 1.5em;
  font-weight: 400;
  box-shadow: 0 2px 12px rgba(30,41,59,0.09);
  text-shadow: 0 1px 8px rgba(0,0,0,0.09);
  letter-spacing: 0.003em;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transition: background 0.3s;
}


/* ============ MODALS & FORMS ============ */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  /* Chrome backdrop-filter isolation: prevents navbar backdrop-filter
     from bleeding into modal content rendering */
  isolation: isolate;
}

.modal-overlay.active { 
  display: flex; 
}

/* Ensure global notifications appear above login/registration modals */
#notificationModal {
  z-index: 3000;
}

.modal-content {
  max-width: 420px;
  width: 100%;
  background: #ffffff !important;
  border-radius: 18px;
  box-shadow: 0 12px 44px 0 rgba(16,38,70,0.23);
  padding: 36px 28px 28px 28px;
  /* Force own compositing layer + isolation — prevents Chrome from
     rendering this box as transparent when backdrop-filter ancestors exist */
  transform: translateZ(0);
  will-change: transform;
  isolation: isolate;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 0 auto;
  color: #1e293b;
}

/* Login modal: кнопка X не должна обрезаться overflow scroll-контейнера */
.login-modal .modal-content {
  overflow: visible;
  max-height: none;
}

.modal-content-inner {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(85vh - 64px);
}

.modal-close-button {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
  background: #64748b;
  color: #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 18px;
  border: none;
  cursor: pointer;
  transition: background 0.14s, transform 0.14s;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
}

.modal-close-button:hover {
  background: #475569;
  color: #fff;
  transform: scale(1.1);
}

/* ============ BUTTONS & FORMS ============ */
button, .btn, .submit-btn {
  padding: 0.7em 2.1em;
  border-radius: 1.4em;
  background: var(--gradient-btn);
  color: #fff;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-size: 1.02em;
  margin-top: 1em;
  transition: background 0.18s, box-shadow 0.13s;
  box-shadow: 0 3px 14px rgba(59,130,246,0.13);
}

button:hover, .btn:hover, .submit-btn:hover {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-main) 100%);
}

.modal-content .submit-btn,
#registrationModalContent .submit-btn,
#loginModalContent .submit-btn {
  background: var(--gradient-btn);
  color: #fff;
  border: none;
  padding: 0.8em 2.2em;
  font-size: 1.1em;
  font-weight: 700;
  border-radius: 1.4em;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 3px 14px rgba(59,130,246,0.13);
  letter-spacing: 0.02em;
  margin-top: 1.2em;
  position: relative;
  overflow: hidden;
}

.modal-content .submit-btn::before,
#registrationModalContent .submit-btn::before,
#loginModalContent .submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.modal-content .submit-btn:hover,
#registrationModalContent .submit-btn:hover,
#loginModalContent .submit-btn:hover {
  background: linear-gradient(90deg, var(--blue-dark) 0%, var(--blue-dark) 100%);
  transform: translateY(-1px) scale(1.01);
}

.modal-content .submit-btn:hover::before,
#registrationModalContent .submit-btn:hover::before,
#loginModalContent .submit-btn:hover::before {
  left: 100%;
}

input, select, textarea {
  font-family: inherit;
  border-radius: 0.8em;
  border: 1.5px solid #e0eaff;
  padding: 0.8em 1.1em;
  margin-bottom: 1.1em;
  font-size: 1em;
  outline: none;
  background: #fff;
  color: #1e293b;
  transition: border 0.16s;
}

input:focus, select:focus, textarea:focus { 
  border-color: #38bdf8; 
}

/* Login Form Specific Styles */
#loginModalContent .forgot-password {
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

#loginModalContent .forgot-password a {
  color: var(--blue-main);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

#loginModalContent .forgot-password a:hover {
  color: var(--blue-dark);
  text-decoration: underline;
}

#loginModalContent .no-account {
  text-align: center;
  margin-top: 1rem;
  color: #64748b;
  font-size: 0.9rem;
}

#loginModalContent .no-account a {
  color: var(--blue-main);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

#loginModalContent .no-account a:hover {
  color: var(--blue-dark);
  text-decoration: underline;
}

.modal-content .note,
#registrationModalContent .note,
#loginModalContent .note {
  color: #64748b;
  font-size: 0.98rem;
  text-align: center;
  margin-top: 14px;
}

/* ============ FIXED BACK BUTTON ============ */
.back-btn-fixed {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 1100;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(124,58,237,0.4);
  transition: opacity 0.2s, transform 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.back-btn-fixed:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ── Floating back / scroll-to-top / scroll-to-bottom shortcuts (site-wide) ── */
.guide-nav-btns { position: fixed; right: 20px; bottom: 30px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.guide-nav-btn { box-sizing: border-box; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,0.15); background: #0d2f6e; color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,0.25); text-decoration: none; opacity: 1; transition: opacity .2s ease, transform .2s ease, background .2s ease; }
.guide-nav-btn.guide-nav-scroll { opacity: 0; pointer-events: none; }
.guide-nav-btn.guide-nav-scroll.visible { opacity: 1; pointer-events: auto; }
.guide-nav-btn:hover { transform: translateY(-2px); background: #133a86; }
@media (max-width: 768px) {
  .guide-nav-btns { right: 10px; bottom: 16px; gap: 8px; }
  .guide-nav-btn { width: 38px; height: 38px; font-size: 1rem; }
}

/* ============ ANIMATIONS ============ */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}


/* Интегрированный хотфикс контраста */
header.header-container,
.header-container {
  color: var(--text-light);
}
.logo-text {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}
.logo-subtitle {
  color: #f9b233;
  -webkit-text-fill-color: #f9b233;
  opacity: 1;
}
header .language-dropdown {
  color: var(--text-light);
}
.language-dropdown .language-name,
.language-dropdown .language-arrow {
  color: inherit;
}
.language-options { 
  color: #1e293b; 
}
.language-option { 
  color: inherit; 
}
nav li { 
  color: var(--text-light); 
}
nav li:hover { 
  color: #fff; 
}


/* ============ RESPONSIVE DESIGN ============ */


@media (max-width: 900px) {
  .header-container {
    padding: 0.7rem 1.2rem;
  }

  .logo-link img{
    height: 40px;
  }
  
  .hero-title { 
    font-size: clamp(1.35rem, 10vw, 2.6rem); 
  }
  
  .hero-subtitle { 
    font-size: clamp(0.97rem, 2.5vw, 1.07rem); 
  }
  
  .nav-list { 
    gap: 0.7rem; 
  }
  
  .language-selector { 
    font-size: 0.95rem; 
  }
  
  .language-selector-container {
    margin-left: 0;
  }
  
  .language-dropdown {
    min-width: 130px;
    padding: 0.25em 0.8em;
  }
}

@media (max-width: 768px) {
  .chatbot-toggle {
    bottom: 70px;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
  
  .chatbot-widget {
    bottom: 130px;
    width: 300px;
    right: 10px;
  }
  
  footer {
    padding: 0.3rem 0;
    font-size: 0.9rem;
  }
  
  .language-selector-container {
    margin-left: 0.5rem;
  }
  
  .language-dropdown {
    min-width: 120px;
    padding: 6px 12px;
  }
  
  .language-current {
    font-size: 13px;
  }
  
  .language-name {
    font-size: 0.8em;
  }
}

@media (max-width: 600px) {
  .hero-title { 
    padding: 0.14em 0.3em; 
    border-radius: 1.3em; 
  }
  
  .hero-subtitle { 
    padding: 0.7em 0.3em; 
    border-radius: 0.7em; 
  }
  
  .header-container { 
    padding: 0.45rem 0.8rem; 
  }
  
  .nav-list { 
    gap: 0.3rem; 
  }
  
  .language-selector-container {
    margin-left: 0.3rem;
  }
  
  .language-dropdown {
    min-width: 100px;
    padding: 4px 8px;
    font-size: 0.85em;
  }
  
  .language-current {
    font-size: 12px;
    gap: 0.2em;
  }
  
  .language-name {
    font-size: 0.75em;
  }
  
  .language-arrow {
    font-size: 0.9em;
  }
  
}

@media (max-width: 480px) {
  .header-container { 
    padding: 0.2rem 0.4rem; 
  }
  
  .hero-title { 
    font-size: clamp(0.9rem, 11vw, 1.13rem); 
  }
  
  .hero-subtitle { 
    font-size: clamp(0.72rem, 3.7vw, 0.88rem); 
  }
  
  .chatbot-toggle {
    bottom: 60px;
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
  
  .chatbot-widget {
    bottom: 110px;
    width: calc(100vw - 20px);
    right: 10px;
    left: 10px;
  }
  
  footer {
    padding: 0.2rem 0;
    font-size: 0.85rem;
    line-height: 1.35;
  }

  /* Ensure our public site footer isn't clipped on small screens */
  .site-footer {
    padding: 18px 0 28px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
    line-height: 1.45;
  }
  .site-footer .footer-bottom {
    line-height: 1.45;
    min-height: 28px;
    padding-top: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  
  .language-selector-container {
    margin-left: 0.2rem;
  }
  
  .language-dropdown {
    min-width: 90px;
    padding: 3px 6px;
    font-size: 0.8em;
  }
  
  .language-current {
    font-size: 11px;
  }
  
  
  .language-name {
    font-size: 0.7em;
  }
  
  .language-options {
    bottom: 70px;
    right: 2px;
    left: 2px;
    min-width: auto;
    max-width: calc(100vw - 10px);
  }
  
  .language-option {
    padding: 0.7em 1em;
    font-size: 0.85em;
  }
}


@media (max-width: 600px) {
  .hero-title, .hero-subtitle {
    white-space: normal;
    word-break: break-word;
  }
}

/* ── Section headings: bright yellow in dark theme ── */
.section h2,
.sec-hdr h2,
.mission-main h2,
.card h2,
.wrap > h2,
.page > h2 {
  color: #fde047;
}

/* ── Registration modals: no scroll, all centered ── */
#providerRegModal .modal-content,
#applicantRegModal .modal-content {
  padding: 20px 24px 16px;
  max-width: 460px;
}
#providerRegModal .modal-content-inner,
#applicantRegModal .modal-content-inner {
  max-height: none;
  overflow-y: visible;
  text-align: center;
}
/* Type selector: left-aligned block */
.reg-type-selector { margin-bottom: 10px; text-align: center; }
.reg-type-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
}
.reg-type-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.reg-type-btn {
  padding: 5px 13px;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 0.87rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  line-height: 1.4;
}
.reg-type-btn:hover  { border-color: #3b82f6; color: #1d4ed8; }
.reg-type-btn.active { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.reg-type-error { color: #ef4444; font-size: 0.82rem; margin-top: 3px; display: none; text-align: left; }
.reg-type-error.visible { display: block; }

/* All form inputs: centered block, uniform width */
#providerRegForm input:not([type="checkbox"]),
#providerRegForm select,
#applicantRegForm input:not([type="checkbox"]),
#applicantRegForm select {
  display: block;
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
  margin: 0 auto 8px;
  text-align: left;
}

/* Inline validation errors: same width as inputs, centered */
#providerRegForm .ux-field-error,
#applicantRegForm .ux-field-error {
  max-width: 300px;
  margin: -4px auto 6px;
  text-align: left;
}
/* After .pw-field (no bottom margin on wrapper) — override the -4px pull-up */
#providerRegForm .pw-field + .ux-field-error,
#applicantRegForm .pw-field + .ux-field-error {
  margin-top: 4px;
}

/* pw-group: shared centering wrapper for pw-field + field-hint */
.pw-group {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}
.pw-group + * { margin-top: 8px; }

/* Password wrapper: flex row so eye button stays visually inside the field */
.pw-field {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1.5px solid #e0eaff;
  border-radius: 0.8em;
  background: #fff;
  overflow: hidden;
  box-sizing: border-box;
}
.pw-field:focus-within { border-color: #38bdf8; }

/* Standalone pw-field (Confirm Password, no pw-group): center like inputs */
#providerRegForm .pw-field,
#applicantRegForm .pw-field {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 8px;
}
.pw-group .pw-field {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
}

/* Input inside pw-field: borderless flex child */
#providerRegForm .pw-field input,
#applicantRegForm .pw-field input {
  flex: 1;
  min-width: 0;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0.8em 0.5em 0.8em 1.1em !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100%;
}

/* Eye toggle: static flex item, always inside the field */
.pw-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 100%;
  min-height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 0 6px 0 0;
  transition: color 0.15s;
}
.pw-toggle:hover { color: #2563eb; }

/* Error after .pw-group */
.pw-group + .ux-field-error,
.pw-field + .ux-field-error {
  margin-top: 4px;
}

.field-hint {
  font-size: 0.79rem;
  color: #94a3b8;
  margin: 4px 0 8px;
  text-align: left;
  padding-left: 1.1em;
}

/* Terms row: inline-flex centered by parent text-align:center */
#providerRegForm .terms-label,
#applicantRegForm .terms-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.87rem;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  vertical-align: middle;
}
/* Spacer divs above/below terms */
#providerRegForm .terms-label,
#applicantRegForm .terms-label {
  margin-top: 16px;
  margin-bottom: 16px;
}
#providerRegForm .terms-wrapper,
#applicantRegForm .terms-wrapper {
  text-align: center;
  padding: 32px 0;
}
.terms-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: #2563eb;
}
.terms-label span, .terms-label a { white-space: nowrap; }

/* Submit button: centered (text-align:center on parent handles it) */
#providerRegForm .submit-btn,
#applicantRegForm .submit-btn {
  display: inline-block;
  margin: 4px auto 0;
  min-width: 190px;
  padding: 0.7em 2em;
}

/* Footer notes */
.reg-switch-link {
  text-align: center;
  font-size: 0.87rem;
  color: #64748b;
  margin: 8px 0 0;
}

/* ============================================================
   EXPLORE MEGA-MENU
============================================================ */


/* Overlay root — full-screen modal */
.explore-menu {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.explore-menu.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

/* Backdrop */
.explore-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2,6,23,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Panel — sheet from top */
.explore-menu-panel {
  position: absolute;
  top: 60px;
  left: 50%;
  right: auto;
  width: 620px;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%) translateY(-12px);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.18);
  transition: transform 0.28s cubic-bezier(0.3,1.1,0.55,1), opacity 0.22s ease;
  max-height: 82vh;
  overflow-y: auto;
}
.explore-menu.is-open .explore-menu-panel {
  transform: translateX(-50%) translateY(0);
}

/* Close button — matches .modal-close-button style */
.explore-menu-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #64748b;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s, transform 0.14s;
  z-index: 1;
  flex-shrink: 0;
}
.explore-menu-close:hover {
  background: #475569;
  transform: scale(1.1);
}

/* Outer wrapper — flex column: Updates strip on top, cols grid below */
.explore-menu-inner {
  padding: 16px 22px 4px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Updates strip */
.explore-updates-strip {
  padding-bottom: 18px;
  margin-bottom: 4px;
  border-bottom: 2px solid #e2e8f0;
}

.explore-updates-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.explore-section-ico.ico-updates { background: rgba(124,58,237,0.10); color: #7c3aed; }

.explore-update-cards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.explore-update-card {
  flex: 1 1 calc(33% - 6px);
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px 11px;
  border-radius: 10px;
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.13s;
}
.explore-update-card:hover {
  background: #f3e8ff;
  border-color: #c4b5fd;
  transform: translateY(-2px);
  color: inherit;
}

.explore-update-tag {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
  margin-bottom: 5px;
  color: #fff;
}
.tag-new      { background: #7c3aed; }
.tag-data     { background: #1d4ed8; }
.tag-deadline { background: #dc2626; }
.tag-guide    { background: #16a34a; }
.tag-enforce  { background: #b45309; }

.explore-update-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}
.explore-update-sub {
  font-size: 11px;
  color: #6b7280;
  line-height: 1.35;
  margin-top: 2px;
}

/* Accordion: vertical stack of sections */
.explore-cols-grid {
  display: flex;
  flex-direction: column;
  padding-top: 8px;
}
/* Sections */
.explore-section {
  border-bottom: 1px solid #e2e8f0;
}
.explore-section:last-child { border-bottom: none; }
/* EU Representative: 2-col inner grid when open */
.explore-cols-grid .explore-section:nth-child(2).is-open .explore-cards {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 5px 14px;
}
/* Learn: 3-col inner grid when open */
.explore-cols-grid .explore-section:nth-child(5).is-open .explore-cards {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px 14px;
}

/* Section header — accordion trigger */
.explore-section-hd {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  user-select: none;
  padding: 13px 0;
  margin-bottom: 0;
  border-bottom: none;
}
.explore-section-hd::after {
  content: '';
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid #9ca3af;
  border-bottom: 2px solid #9ca3af;
  transform: rotate(45deg);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.explore-section.is-open .explore-section-hd::after { transform: rotate(-135deg); }

.explore-section-ico {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.explore-section-ico.ico-find  { background: rgba(37,99,235,0.10); color: #1d4ed8; }
.explore-section-ico.ico-tools { background: rgba(124,58,237,0.10); color: #7c3aed; }
.explore-section-ico.ico-svc   { background: rgba(22,163,74,0.10); color: #15803d; }
.explore-section-ico.ico-learn { background: rgba(180,83,9,0.10);  color: #b45309; }
.explore-section-ico.ico-ear   { background: rgba(15,118,110,0.10); color: #0f766e; }

.explore-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #374151;
  margin: 0 0 2px;
}
.explore-section-subdesc {
  font-size: 11.5px;
  color: #6b7280;
  margin: 0;
  line-height: 1.3;
}

/* Cards — hidden until section is open */
.explore-cards {
  display: none;
  flex-direction: column;
  gap: 5px;
}
.explore-section.is-open .explore-cards {
  display: flex;
  padding-bottom: 12px;
}

.explore-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.13s, color 0.13s;
}
/* Find — blue */
.explore-cols-grid .explore-section:nth-child(1) .explore-card:hover {
  background: #eff6ff; border-color: #bfdbfe; color: #0f172a; transform: translateX(3px);
}
/* EU Representative — teal (no translateX, items in 2-col grid) */
.explore-cols-grid .explore-section:nth-child(2) .explore-card:hover {
  background: #f0fdfa; border-color: #99f6e4; color: #0f172a;
}
/* Tools — purple */
.explore-cols-grid .explore-section:nth-child(3) .explore-card:hover {
  background: #faf5ff; border-color: #e9d5ff; color: #0f172a; transform: translateX(3px);
}
/* Services — green */
.explore-cols-grid .explore-section:nth-child(4) .explore-card:hover {
  background: #f0fdf4; border-color: #bbf7d0; color: #0f172a; transform: translateX(3px);
}
/* Learn — amber (no translateX, items in 3-col grid) */
.explore-cols-grid .explore-section:nth-child(5) .explore-card:hover {
  background: #fffbeb; border-color: #fde68a; color: #0f172a;
}

.explore-card-ico {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #64748b;
  transition: color 0.13s, background 0.13s;
}
.explore-card:hover .explore-card-ico {
  background: #cbd5e1;
  color: #334155;
}

.explore-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.25;
}
.explore-card-sub {
  font-size: 11px;
  color: #4b5563;
  margin-top: 1px;
  line-height: 1.3;
}
.explore-card:hover .explore-card-sub { color: #374151; }

/* "All Guides" card accent */
.explore-card-all { background: #fffbeb; border-color: #fde68a; }
.explore-card-all .explore-card-title { color: #92400e; font-weight: 600; }
.explore-card-all:hover { background: #fef3c7; border-color: #fcd34d; }
.explore-card-all:hover .explore-card-title { color: #78350f; }

/* Footer strip */
.explore-menu-ft {
  padding: 10px 22px 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  align-items: center;
}
.explore-menu-ft a {
  color: #6b7280;
  font-size: 12px;
  text-decoration: none;
  transition: color 0.14s;
}
.explore-menu-ft a:hover { color: #111827; }
.explore-menu-ft-sep { color: #d1d5db; font-size: 11px; }

/* Stagger animation — plays when section expands */
.explore-section.is-open .explore-card {
  animation: xCardIn 0.22s ease both;
}
@keyframes xCardIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.explore-section:nth-child(1) .explore-card:nth-child(1) { animation-delay: 0.04s; }
.explore-section:nth-child(1) .explore-card:nth-child(2) { animation-delay: 0.07s; }
.explore-section:nth-child(1) .explore-card:nth-child(3) { animation-delay: 0.10s; }
.explore-section:nth-child(1) .explore-card:nth-child(4) { animation-delay: 0.13s; }
.explore-section:nth-child(1) .explore-card:nth-child(5) { animation-delay: 0.16s; }
.explore-section:nth-child(2) .explore-card:nth-child(1) { animation-delay: 0.06s; }
.explore-section:nth-child(2) .explore-card:nth-child(2) { animation-delay: 0.09s; }
.explore-section:nth-child(2) .explore-card:nth-child(3) { animation-delay: 0.12s; }
.explore-section:nth-child(2) .explore-card:nth-child(4) { animation-delay: 0.15s; }
.explore-section:nth-child(2) .explore-card:nth-child(5) { animation-delay: 0.18s; }
.explore-section:nth-child(3) .explore-card:nth-child(1) { animation-delay: 0.05s; }
.explore-section:nth-child(3) .explore-card:nth-child(2) { animation-delay: 0.08s; }
.explore-section:nth-child(3) .explore-card:nth-child(3) { animation-delay: 0.11s; }
.explore-section:nth-child(3) .explore-card:nth-child(4) { animation-delay: 0.14s; }
.explore-section:nth-child(3) .explore-card:nth-child(5) { animation-delay: 0.17s; }
.explore-section:nth-child(3) .explore-card:nth-child(6) { animation-delay: 0.20s; }

/* Mobile — tablet and below */
@media (max-width: 860px) {
  .explore-menu-inner { padding: 14px 16px 8px; }
  /* Reset inner multi-col grids to 1 column on mobile */
  .explore-cols-grid .explore-section:nth-child(2).is-open .explore-cards,
  .explore-cols-grid .explore-section:nth-child(5).is-open .explore-cards { grid-template-columns: 1fr !important; }
  .explore-update-cards { gap: 8px; flex-wrap: wrap; }
  .explore-update-card { flex: 1 1 calc(50% - 8px); min-width: 140px; }
  .explore-menu-ft { padding: 10px 16px 16px; gap: 6px 14px; }
  .explore-card { min-width: 0; overflow: hidden; }
  .explore-card-title, .explore-card-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Mobile — small phones: bottom sheet */
@media (max-width: 580px) {
  .explore-menu-panel {
    top: auto;
    bottom: 0;
    border-bottom: none;
    border-top: 1px solid #e2e8f0;
    border-radius: 20px 20px 0 0;
    transform: translateY(calc(100% + 10px));
    max-height: 88vh;
  }
  .explore-menu.is-open .explore-menu-panel { transform: translateY(0); }
  /* Drag handle */
  .explore-menu-panel::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 2px;
    margin: 10px auto 6px;
  }
  .explore-menu-close { top: 18px; }
  /* Update cards: 1 per row on small phones */
  .explore-updates-strip { padding-bottom: 14px; }
  .explore-update-cards { flex-wrap: wrap; }
  .explore-update-card { flex: 1 1 100%; min-width: 0; }
}
