html.wayf-theme--light {
  color-scheme: light;
}

html.wayf-theme--dark {
  color-scheme: dark;
}

[data-wayf-theme-picker] {
  position: relative;
  display: inline-flex;
}

.wayf-theme-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--wayf-icon-btn-border, #d1d5db);
  border-radius: 10px;
  background: var(--wayf-icon-btn-bg, #ffffff);
  color: var(--wayf-icon-btn-color, #64748b);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.wayf-theme-trigger:hover {
  border-color: var(--wayf-icon-btn-hover-border, #94a3b8);
  background: var(--wayf-icon-btn-hover-bg, #f8fafc);
  color: var(--wayf-icon-btn-hover-color, #334155);
}

html.wayf-theme--dark .wayf-theme-trigger:hover {
  border-color: var(--wayf-icon-btn-hover-border, rgba(255, 255, 255, 0.28));
  background: var(--wayf-icon-btn-hover-bg, rgba(255, 255, 255, 0.1));
  color: var(--wayf-icon-btn-hover-color, #f1f5f9);
}

.wayf-theme-trigger:focus-visible,
.wayf-theme-menu-item:focus-visible {
  outline: 2px solid var(--wayf-focus-ring, #2563eb);
  outline-offset: 2px;
}

.wayf-theme-trigger svg {
  display: block;
  width: 18px;
  height: 18px;
  color: inherit;
}

.wayf-theme-menu[hidden] {
  display: none;
}

.wayf-theme-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 11rem;
  padding: 6px;
  border: 1px solid var(--wayf-icon-btn-border, #d1d5db);
  border-radius: 12px;
  background: var(--wayf-card-bg, #ffffff);
  color: var(--wayf-heading, #0f172a);
  box-shadow:
    0 12px 32px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(15, 23, 42, 0.04);
}

html.wayf-theme--dark .wayf-theme-menu {
  border-color: var(--wayf-icon-btn-border, rgba(255, 255, 255, 0.18));
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.wayf-theme-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.wayf-theme-menu-item:hover,
.wayf-theme-menu-item:focus-visible {
  background: var(--wayf-theme-menu-hover, rgba(15, 23, 42, 0.06));
}

html.wayf-theme--dark .wayf-theme-menu-item:hover,
html.wayf-theme--dark .wayf-theme-menu-item:focus-visible {
  background: var(--wayf-theme-menu-hover, rgba(255, 255, 255, 0.08));
}

.wayf-theme-menu-item:focus-visible {
  outline-offset: -2px;
}

.wayf-theme-menu-check {
  visibility: hidden;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: currentColor;
}

.wayf-theme-menu-check--active {
  visibility: visible;
}

.wayf-theme-menu-check svg {
  display: block;
  width: 14px;
  height: 14px;
  color: inherit;
}
