/* FrescoStar i18n selector — floating language switcher
   ---------------------------------------------------------------
   - Position: fixed top-right, safe-area aware, always visible.
   - Style: glassy pill with two segments (ES | EN).
   - Active segment uses the accent gradient from the brand card.
   - Works on top of dark and light backgrounds.
   - Doesn't interfere with FAB / nav: max-width respects safe-area.
*/

.fs-lang-selector {
  position: static;

  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 8px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);

  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  user-select: none;
  -webkit-user-select: none;

  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fs-lang-selector--page {
  display: flex;
  width: max-content;
  margin: 0 0 10px auto;
}

.fs-lang-selector--app {
  margin: 0;
}

.fs-lang-selector--admin {
  margin-right: 8px;
}

/* Public review page (r.html): fixed small pill in the screen's top-right
   corner, clear of the centered header/title and the choice card. */
.fs-lang-selector--review {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 9999;
}

.fs-lang-selector--fallback {
  margin: 12px 12px 0 auto;
}

.app-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.fs-lang-selector:hover {
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.08),
    0 10px 30px rgba(15, 23, 42, 0.12);
}

.fs-lang-option {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: rgba(15, 23, 42, 0.55);
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  padding: 6px 10px;
  min-width: 36px;
  border-radius: 999px;
  line-height: 1;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.fs-lang-option:hover {
  color: rgba(15, 23, 42, 0.85);
  background: rgba(15, 23, 42, 0.04);
}

.fs-lang-option:active {
  transform: scale(0.96);
}

.fs-lang-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.28);
}

.fs-lang-option.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, #1a73e8 0%, #4f46e5 100%);
  box-shadow:
    0 1px 2px rgba(66, 133, 244, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.fs-lang-option.is-active:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #1769d2 0%, #4338ca 100%);
}

/* On small screens, slightly compact to coexist with FAB and nav. */
@media (max-width: 480px) {
  .fs-lang-selector {
    font-size: 0.68rem;
    padding: 3px;
  }
  .fs-lang-option {
    padding: 5px 9px;
    min-width: 32px;
  }
}

/* Respect reduced motion preference. */
@media (prefers-reduced-motion: reduce) {
  .fs-lang-selector,
  .fs-lang-option {
    transition: none;
  }
  .fs-lang-option:active {
    transform: none;
  }
}
