/* Language picker — Frisk bespoke sheet + chrome variants */
.lang-modal-trigger {
  --lang-trigger-bg: rgba(30, 41, 59, 0.75);
  --lang-trigger-border: rgba(148, 163, 184, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  max-width: 20rem;
  margin: 0 auto;
  padding: 0.88rem 1.2rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--brand, #f1f5f9);
  background: var(--lang-trigger-bg);
  border: 1px solid var(--lang-trigger-border);
  border-radius: 14px;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.92) inset,
    0 6px 20px -10px rgba(26, 46, 36, 0.14);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  transition:
    border-color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.lang-modal-trigger:hover {
  --lang-trigger-bg: rgba(51, 65, 85, 0.88);
  --lang-trigger-border: rgba(139, 124, 240, 0.42);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 32px -14px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(108, 92, 231, 0.12);
}

.lang-modal-trigger:active {
  transform: scale(0.985);
}

.lang-modal-trigger:focus-visible {
  outline: 2px solid var(--primary, #6c5ce7);
  outline-offset: 3px;
}

.lang-modal-trigger.is-open {
  --lang-trigger-bg: rgba(51, 65, 85, 0.95);
  --lang-trigger-border: rgba(139, 124, 240, 0.5);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 0 0 3px rgba(108, 92, 231, 0.2),
    0 14px 36px -16px rgba(108, 92, 231, 0.25);
}

.lang-modal-trigger.is-open .lang-modal-trigger-chevron {
  transform: rotate(180deg);
}

.lang-modal-trigger-kicker {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-tertiary, #8b93a4);
  opacity: 0.88;
}

.lang-modal-trigger-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  text-align: left;
  flex: 1;
  min-width: 0;
}

.lang-modal-trigger-value {
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--brand, #f1f5f9);
  letter-spacing: -0.02em;
}

.lang-modal-trigger-code {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary, #6c5ce7);
  opacity: 0.92;
}


.lang-modal-trigger-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  font-size: 1rem;
  line-height: 1;
  filter: saturate(1.02);
}

.lang-modal-trigger--header .lang-modal-trigger-flag,
.lang-modal-trigger--footer .lang-modal-trigger-flag {
  min-width: 2.1rem;
  padding: 0.12rem 0.2rem;
  border-radius: 8px;
  background: rgba(108, 92, 231, 0.08);
}

.lang-modal-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  font-size: 1rem;
  line-height: 1;
}

.lang-modal-trigger-chevron {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  color: var(--text-tertiary, #8b93a4);
  opacity: 0.72;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.lang-modal-trigger:hover .lang-modal-trigger-chevron {
  opacity: 0.95;
  color: var(--primary, #6c5ce7);
}

/* Optional leading icon (header / footer) */
.lang-modal-trigger-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(45, 212, 191, 0.12) 0%, rgba(108, 92, 231, 0.15) 100%);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--brand, #f1f5f9);
}

.lang-modal-trigger-icon svg {
  width: 1.05rem;
  height: 1.05rem;
  opacity: 0.88;
}

/* Header: compact locale control */
.header-lang {
  padding: 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.6) 0%, rgba(108, 92, 231, 0.12) 100%);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 8px 24px -14px rgba(0, 0, 0, 0.35);
}

.lang-modal-trigger--header {
  max-width: none;
  margin: 0;
  padding: 0.5rem 0.75rem 0.5rem 0.55rem;
  gap: 0.5rem;
  border-radius: 999px;
  --lang-trigger-bg: rgba(30, 41, 59, 0.55);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 6px 22px -12px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.lang-modal-trigger--header:hover {
  --lang-trigger-bg: rgba(51, 65, 85, 0.82);
}

.lang-modal-trigger--header .lang-modal-trigger-icon {
  width: 1.95rem;
  height: 1.95rem;
  border-radius: 999px;
  background: linear-gradient(155deg, rgba(108, 92, 231, 0.14) 0%, rgba(26, 46, 36, 0.06) 100%);
  border: 1px solid rgba(108, 92, 231, 0.12);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.lang-modal-trigger--header .lang-modal-trigger-icon svg {
  width: 0.95rem;
  height: 0.95rem;
}

.lang-modal-trigger--header .lang-modal-trigger-kicker {
  display: none;
}

.lang-modal-trigger--header .lang-modal-trigger-main {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

.lang-modal-trigger--header .lang-modal-trigger-value {
  font-size: 0.8125rem;
  font-weight: 650;
}

.lang-modal-trigger--header .lang-modal-trigger-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.28rem 0.42rem;
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff;
  background: linear-gradient(165deg, #8b7cf0 0%, var(--primary, #6c5ce7) 45%, var(--primary-dark, #5548d9) 100%);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 2px 8px -2px rgba(108, 92, 231, 0.45);
}

.lang-modal-trigger--header .lang-modal-trigger-chevron {
  width: 0.95rem;
  height: 0.95rem;
  margin-left: 0.1rem;
  opacity: 0.65;
}

.lang-modal-trigger--header.is-open .lang-modal-trigger-chevron {
  opacity: 0.9;
}

/* Footer column */
.footer-lang-modal {
  margin-top: 0;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.lang-modal-trigger--footer {
  max-width: none;
  margin: 0;
  padding: 0.88rem 1.15rem;
  border-radius: 999px;
  justify-content: flex-start;
  text-align: left;
  --lang-trigger-bg: rgba(30, 41, 59, 0.65);
}

.lang-modal-trigger--footer .lang-modal-trigger-icon {
  width: 2.15rem;
  height: 2.15rem;
}

.lang-modal-trigger--footer .lang-modal-trigger-flag {
  color: #fff;
  background: linear-gradient(165deg, #8b7cf0 0%, var(--primary, #6c5ce7) 50%, var(--primary-dark, #5548d9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.legal-footer-lang {
  margin-top: 1.35rem;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(26, 46, 36, 0.08);
}

.legal-footer-lang .footer-lang-modal,
.legal-footer-lang.footer-lang-modal {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(26, 46, 36, 0.06);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

/* Modal */
.lang-modal[hidden] {
  display: none !important;
}

.lang-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 480px) {
  .lang-modal {
    align-items: center;
    padding: 1.5rem;
  }
}

.lang-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: lang-backdrop-in 0.28s ease both;
}

@keyframes lang-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.lang-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 22.5rem;
  max-height: min(78vh, 29rem);
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background: linear-gradient(168deg, #1e293b 0%, #0f172a 45%, #0b1220 100%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px 22px 0 0;
  box-shadow:
    0 -12px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  animation: lang-modal-in 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (min-width: 480px) {
  .lang-modal-panel {
    border-radius: 22px;
    max-height: min(86vh, 31rem);
    box-shadow:
      0 28px 72px -24px rgba(26, 46, 36, 0.22),
      0 0 0 1px rgba(255, 255, 255, 0.9) inset;
  }
}

@keyframes lang-modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lang-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.35rem 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.lang-modal-title {
  font-family: var(--font-display, "Fraunces", Georgia, serif);
  font-size: 1.3125rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #f1f5f9;
  margin: 0;
  line-height: 1.2;
}

.lang-modal-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.lang-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.2);
}

.lang-modal-close:focus-visible {
  outline: 2px solid var(--primary, #6c5ce7);
  outline-offset: 2px;
}

.lang-modal-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0.85rem 1.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.lang-modal-list li {
  margin: 0;
}

.lang-modal-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.92rem 1.05rem;
  margin: 0.25rem 0;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  color: #e2e8f0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.2s ease;
}

.lang-modal-option:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.12);
}

.lang-modal-option:active {
  transform: scale(0.99);
}

.lang-modal-option:focus-visible {
  outline: 2px solid var(--primary, #6c5ce7);
  outline-offset: 0;
}

.lang-modal-option.is-current {
  position: relative;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.35) 0%, rgba(45, 212, 191, 0.12) 100%);
  border-color: rgba(139, 124, 240, 0.45);
  font-weight: 650;
  cursor: default;
  pointer-events: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 0 0 1px rgba(108, 92, 231, 0.15);
}

.lang-modal-option.is-current::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65rem;
  bottom: 0.65rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--primary, #6c5ce7) 0%, var(--primary-dark, #5548d9) 100%);
}

.lang-modal-option .lang-modal-native {
  letter-spacing: -0.018em;
}

.lang-modal-option .lang-modal-flag {
  min-width: 2rem;
  font-size: 1rem;
  line-height: 1;
  filter: saturate(1.02);
}

.lang-modal-option.is-current .lang-modal-flag {
  padding: 0.24rem 0.5rem;
  border-radius: 999px;
  background: linear-gradient(165deg, #8b7cf0 0%, var(--primary, #6c5ce7) 50%, var(--primary-dark, #5548d9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.lang-modal-handle {
  display: block;
  width: 2.5rem;
  height: 4px;
  margin: 0.7rem auto 0;
  background: rgba(26, 46, 36, 0.1);
  border-radius: 999px;
}

@media (min-width: 480px) {
  .lang-modal-handle {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lang-modal-backdrop,
  .lang-modal-panel {
    animation: none;
  }

  .lang-modal:not([hidden]) .lang-modal-list li {
    animation: none;
  }

  .lang-modal-trigger,
  .lang-modal-trigger-chevron,
  .lang-modal-option {
    transition: none;
  }
}

/* —— Premium switcher refinements —— */
.lang-modal-trigger {
  border-radius: 999px;
  min-height: 3rem;
  letter-spacing: -0.013em;
}

.lang-modal-trigger-icon,
.lang-modal-trigger-flag {
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-lang {
  padding: 4px;
  border-radius: 999px;
  background: linear-gradient(130deg, rgba(15, 23, 42, 0.65) 0%, rgba(108, 92, 231, 0.14) 100%);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 8px 20px -14px rgba(0, 0, 0, 0.35);
}

.lang-modal-trigger--header {
  min-height: 2.9rem;
  justify-content: flex-start;
  align-items: center;
  gap: 0.56rem;
  padding: 0.52rem 0.78rem 0.52rem 0.52rem;
  border-radius: 999px;
}

.lang-modal-trigger--header .lang-modal-trigger-main {
  min-width: 0;
  gap: 0.46rem;
}

.lang-modal-trigger--header .lang-modal-trigger-value {
  white-space: nowrap;
  letter-spacing: -0.015em;
}

.lang-modal-trigger--header .lang-modal-trigger-flag {
  min-width: 2.2rem;
  border-radius: 999px;
  padding: 0.3rem 0.45rem;
}

.lang-modal-trigger--header .lang-modal-trigger-chevron {
  margin-left: 0.2rem;
}

.lang-modal-trigger--header.is-open {
  --lang-trigger-border: rgba(139, 124, 240, 0.55);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 0 0 3px rgba(108, 92, 231, 0.22),
    0 16px 36px -20px rgba(108, 92, 231, 0.35);
}

.lang-modal-trigger--header.is-open .lang-modal-trigger-icon,
.lang-modal-trigger--header:hover .lang-modal-trigger-icon {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.62) inset,
    0 6px 16px -10px rgba(108, 92, 231, 0.38);
}

.lang-modal-trigger--header.is-open .lang-modal-trigger-flag,
.lang-modal-trigger--header:hover .lang-modal-trigger-flag {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 7px 16px -9px rgba(108, 92, 231, 0.4);
}

.lang-modal-trigger--footer {
  border-radius: 999px;
  min-height: 3.18rem;
}

.footer-lang-modal {
  border-radius: 999px;
}

.lang-modal-panel {
  overflow: hidden;
  border-radius: 24px 24px 0 0;
}

@media (min-width: 480px) {
  .lang-modal-panel {
    border-radius: 24px;
  }
}

.lang-modal-list {
  padding: 0.72rem 0.9rem 1.24rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.5) 0%, rgba(15, 23, 42, 0.2) 100%);
}

.lang-modal:not([hidden]) .lang-modal-list li {
  animation: lang-option-rise 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.lang-modal:not([hidden]) .lang-modal-list li:nth-child(1) {
  animation-delay: 0.04s;
}
.lang-modal:not([hidden]) .lang-modal-list li:nth-child(2) {
  animation-delay: 0.08s;
}
.lang-modal:not([hidden]) .lang-modal-list li:nth-child(3) {
  animation-delay: 0.12s;
}
.lang-modal:not([hidden]) .lang-modal-list li:nth-child(4) {
  animation-delay: 0.16s;
}
.lang-modal:not([hidden]) .lang-modal-list li:nth-child(5) {
  animation-delay: 0.2s;
}

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

.lang-modal-option {
  position: relative;
  border-color: rgba(148, 163, 184, 0.08);
}

.lang-modal-option:hover {
  transform: translateX(2px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(108, 92, 231, 0.12) 100%);
}

.lang-modal-option:focus-visible {
  outline-offset: 1px;
}

.lang-modal-option.is-current {
  border-color: rgba(139, 124, 240, 0.45);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 8px 18px -14px rgba(108, 92, 231, 0.35),
    0 0 0 1px rgba(108, 92, 231, 0.15);
}

.lang-modal-option {
  justify-content: flex-start;
}

.lang-modal-option .lang-modal-native {
  margin-left: 0;
}

.lang-modal-option .lang-modal-flag {
  margin-left: auto;
}

.lang-modal-option.is-current {
  padding-left: 2.95rem;
}

.lang-modal-option.is-current::after {
  content: "✓";
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(165deg, #8b7cf0 0%, var(--primary, #6c5ce7) 50%, var(--primary-dark, #5548d9) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

@media (max-width: 479px) {
  .lang-modal-trigger {
    padding: 0.82rem 1rem;
  }

  .lang-modal-trigger--header {
    padding: 0.5rem 0.68rem 0.5rem 0.5rem;
    min-height: 2.72rem;
    gap: 0.45rem;
  }

  .lang-modal-trigger--header .lang-modal-trigger-value {
    font-size: 0.78rem;
  }

  .lang-modal-trigger--header .lang-modal-trigger-flag {
    padding: 0.24rem 0.38rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lang-modal-trigger-icon,
  .lang-modal-trigger-flag {
    transition: none !important;
    transform: none !important;
  }

  .lang-modal-option:hover {
    transform: none !important;
  }
}


/* SVG flag support */
.lang-flag-img {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  object-fit: cover;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 4px 10px rgba(15, 23, 42, 0.18);
}

.lang-modal-trigger-flag .lang-flag-img {
  width: 1.45rem;
  height: 1.45rem;
}

.lang-modal-option.is-current .lang-modal-flag {
  padding: 0.3rem 0.45rem;
}

.lang-modal-option .lang-modal-flag,
.lang-modal-trigger-flag {
  font-size: 0;
}
