/* ---------- Theme switch + language switch + sunrise/sunset transition ---------- */
.header-tools,
.topbar-tools {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}
.header-tools { margin-left: auto; }
.topbar-tools { margin-left: auto; }
.dash-topbar .topbar-tools { margin-left: auto; }
.dash-topbar .dash-user { margin-left: 0; }

.theme-toggle {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}
.theme-toggle:focus-visible { outline: 2px solid #C2186A; outline-offset: 3px; }
.theme-toggle-track {
  position: relative;
  width: 50px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  border: 1px solid #E8D8EF;
  border-radius: 999px;
  background: #F6ECFA;
  transition: background .35s ease, border-color .35s ease;
}
.theme-toggle .tt-icon {
  position: relative;
  z-index: 2;
  font-size: .7rem;
  line-height: 1;
  transition: opacity .25s ease, color .25s ease;
}
.theme-toggle .tt-icon svg {
  width: 13px;
  height: 13px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .tt-sun-ico { color: #D97706; opacity: 1; }
.theme-toggle .tt-moon-ico { color: #7B2CBF; opacity: .35; }
.theme-toggle .tt-thumb {
  position: absolute;
  z-index: 1;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(43,11,51,.18);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), background .35s ease;
}
html[data-theme="dark"] .theme-toggle-track { background: #2A1837; border-color: #4B2E5D; }
html[data-theme="dark"] .theme-toggle .tt-sun-ico { opacity: .35; }
html[data-theme="dark"] .theme-toggle .tt-moon-ico { opacity: 1; color: #F4C7FF; }
html[data-theme="dark"] .theme-toggle .tt-thumb { transform: translateX(22px); background: #12081C; }

.lang-switch { margin: 0; flex: 0 0 auto; }
.lang-switch select {
  width: auto;
  min-width: 82px;
  max-width: 112px;
  padding: 6px 24px 6px 10px;
  border: 1px solid #E8D8EF;
  border-radius: 999px;
  background-color: #fff;
  color: #4A3350;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #8B6B98 50%),
    linear-gradient(135deg, #8B6B98 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.lang-switch select:focus { outline: none; border-color: #C2186A; box-shadow: 0 0 0 3px rgba(194,24,106,.12); }
html[data-theme="dark"] .lang-switch select {
  background-color: #1B1024;
  border-color: #3D254B;
  color: #EADFF0;
  background-image:
    linear-gradient(45deg, transparent 50%, #C9A9D8 50%),
    linear-gradient(135deg, #C9A9D8 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
html[data-theme="dark"] .lang-switch select:focus { border-color: #F472B6; box-shadow: 0 0 0 3px rgba(244,114,182,.16); }

@media (max-width: 820px) {
  .header-tools { gap: 6px; }
  .header-tools .lang-switch select { min-width: 72px; max-width: 88px; font-size: .68rem; padding-left: 8px; }
  .theme-toggle-track { width: 46px; height: 26px; }
  .theme-toggle .tt-thumb { width: 20px; height: 20px; }
  html[data-theme="dark"] .theme-toggle .tt-thumb { transform: translateX(20px); }
  .topbar-tools { gap: 6px; }
  .topbar-tools .lang-switch { display: none; }
}

/* Full-screen sunrise / sunset transition (same on desktop and mobile). */
.theme-transition {
  position: fixed;
  inset: 0;
  z-index: 100000;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity .28s ease;
}
.theme-transition.is-active { opacity: 1; }
.theme-transition.is-leaving { opacity: 0; }
.theme-transition--light {
  background: linear-gradient(180deg, #1b1b3a 0%, #4b2c61 25%, #b84d78 50%, #ff9a6b 72%, #ffe3b3 100%);
}
.theme-transition--dark {
  background: linear-gradient(180deg, #ffe3b3 0%, #ff9a6b 22%, #b84d78 48%, #4b2c61 72%, #12081c 100%);
}
.tt-sky {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 70%, rgba(255,255,255,.18), transparent 58%);
}
.tt-sun {
  position: absolute;
  left: 50%;
  top: 0;
  width: 150px;
  height: 150px;
  margin-left: -75px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 34%, #fffbe8 0%, #ffe08a 32%, #ffb347 62%, rgba(255,159,28,0) 72%);
  box-shadow: 0 0 90px 28px rgba(255,190,80,.45), 0 0 160px 70px rgba(255,130,60,.18);
  will-change: transform, opacity;
}
.theme-transition--light .tt-sun {
  transform: translateY(96vh) scale(.45);
  opacity: 0;
  transition: transform 1.2s cubic-bezier(.2,.8,.2,1), opacity .45s ease;
}
.theme-transition--light.is-active .tt-sun {
  transform: translateY(12vh) scale(1);
  opacity: 1;
}
.theme-transition--dark .tt-sun {
  transform: translateY(10vh) scale(1);
  opacity: 1;
  transition: transform 1.2s cubic-bezier(.2,.8,.2,1), opacity .45s ease;
}
.theme-transition--dark.is-active .tt-sun {
  transform: translateY(96vh) scale(.4);
  opacity: 0;
}
.tt-stars {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255,255,255,.9) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 28% 12%, rgba(255,255,255,.8) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 43% 22%, rgba(255,255,255,.75) 50%, transparent 51%),
    radial-gradient(2px 2px at 61% 14%, rgba(255,255,255,.9) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 24%, rgba(255,255,255,.85) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 10%, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 18% 36%, rgba(255,255,255,.65) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 70% 38%, rgba(255,255,255,.7) 50%, transparent 51%);
  transition: opacity .8s ease;
}
.theme-transition--dark.is-active .tt-stars { opacity: 1; }
.theme-transition--light .tt-stars { opacity: 1; }
.theme-transition--light.is-active .tt-stars { opacity: 0; }
.tt-horizon {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -2px;
  height: 24vh;
  background: #150a1e;
  clip-path: polygon(0 72%, 8% 62%, 16% 70%, 25% 54%, 34% 66%, 42% 48%, 51% 62%, 61% 44%, 70% 60%, 79% 50%, 88% 64%, 100% 56%, 100% 100%, 0 100%);
  opacity: .88;
}
.theme-transition--light .tt-horizon { background: #2a1635; }
.tt-horizon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.35));
}
.tt-copy {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 30px rgba(0,0,0,.35);
  opacity: 0;
  transition: opacity .4s ease, transform .6s ease;
}
.theme-transition.is-active .tt-copy { opacity: 1; transform: translateY(-54%); }
.tt-copy small {
  display: block;
  margin-bottom: 6px;
  color: rgba(255,255,255,.78);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.tt-copy strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -.02em;
}
@media (max-width: 600px) {
  .tt-sun { width: 112px; height: 112px; margin-left: -56px; }
  .tt-horizon { height: 20vh; }
  .tt-copy strong { font-size: 2rem; }
  .tt-copy small { font-size: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-transition,
  .theme-transition .tt-sun,
  .theme-transition .tt-stars,
  .theme-transition .tt-copy {
    transition-duration: .01ms !important;
  }
}

/* Referral code */
.referral-code { font-size: 1.5rem; font-weight: 800; color: var(--navy); letter-spacing: .1em; margin: 6px 0; }
html[data-theme="dark"] .referral-code { color: #ffb7d5; }

/* Auth card utility row */
.auth-tools { display: flex; justify-content: flex-end; margin: -10px 0 0; }

@media (max-width: 1100px) {
  .header-inner .brand { flex: 0 0 auto; }
  .main-nav { gap: 10px; font-size: .82rem; }
  .header-tools { gap: 6px; }
}

/* Google public-page translator: hide its toolbar and keep the page aligned. */
.goog-te-banner-frame,
iframe.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
#google_translate_element,
.goog-te-gadget { display: none !important; }
body { top: 0 !important; }
.goog-tooltip, .goog-tooltip:hover { display: none !important; }

/* Google translate banner iframe uses a generated class, not goog-te-banner-frame. */
iframe.skiptranslate { display: none !important; }