/* Pristine Coach — Trilingual language picker
 * Reuses palette tokens from /static/app/app.css:
 *   --bg, --bg-2, --bg-3, --fg, --fg-dim, --accent, --border, --radius
 * Falls back to literal hex if those tokens aren't loaded (e.g. on
 * non-app_shell pages like index.html which has its own palette).
 */

.pc-lang-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 11, 15, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

.pc-lang-modal[hidden] { display: none !important; }

.pc-lang-modal__card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-2, #131a23);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius, 14px);
  padding: 28px 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.pc-lang-modal__title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 6px;
  color: var(--fg, #e6edf3);
  text-align: center;
}

.pc-lang-modal__sub {
  font-size: 13px;
  color: var(--fg-dim, #8b97a7);
  margin: 0 0 22px;
  text-align: center;
}

.pc-lang-modal__buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pc-lang-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  background: var(--bg-3, #1c2632);
  color: var(--fg, #e6edf3);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.05s ease;
  font-family: inherit;
}

.pc-lang-btn:hover,
.pc-lang-btn:focus-visible {
  border-color: var(--accent, #4fd1c5);
  background: var(--bg-2, #131a23);
  outline: none;
}

.pc-lang-btn:active { transform: scale(0.98); }

.pc-lang-btn__flag {
  font-size: 28px;
  line-height: 1;
  flex: 0 0 auto;
}

.pc-lang-btn__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.pc-lang-btn__native {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg, #e6edf3);
}

.pc-lang-btn__hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--fg-dim, #8b97a7);
}

/* Persistent header switcher ─────────────────────────────────── */

.pc-lang-switcher {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: 12px;
  z-index: 9000;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

/* When the switcher lives inside the nav (the unified marketing/auth header),
   it should sit in normal flow next to the Sign in CTA, not float on top of it. */
.pc-nav .pc-lang-switcher,
.pc-nav-right .pc-lang-switcher {
  position: relative;
  top: auto;
  right: auto;
  z-index: 1;
}

.pc-lang-button {
  min-height: 36px;
  min-width: 56px;
  padding: 6px 12px;
  background: var(--bg-3, rgba(28, 38, 50, 0.85));
  color: var(--fg, #e6edf3);
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  font-family: inherit;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pc-lang-button:hover,
.pc-lang-button:focus-visible {
  border-color: var(--accent, #4fd1c5);
  outline: none;
}

.pc-lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 168px;
  background: var(--bg-2, #131a23);
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
}

.pc-lang-dropdown[hidden] { display: none; }

.pc-lang-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 44px;
  color: var(--fg, #e6edf3);
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.pc-lang-dropdown a:hover,
.pc-lang-dropdown a:focus-visible {
  background: var(--bg-3, #1c2632);
  color: var(--accent, #4fd1c5);
  outline: none;
}

.pc-lang-dropdown a[data-active="1"] {
  color: var(--accent, #4fd1c5);
}

@media (max-width: 380px) {
  .pc-lang-modal__card { padding: 22px 16px; }
  .pc-lang-modal__title { font-size: 20px; }
  .pc-lang-btn { font-size: 15px; }
}
