/* =========================================================================
   Language picker — public shells (marketing + auth)

   The wallet already carries this component in wallet.css, keyed to the
   --wl-* palette. Public pages never load wallet.css, so the same markup is
   restated here against the marketing tokens (--bg/--surface/--text/--muted/
   --border/--accent), which already flip between light and dark.
   ========================================================================= */
.wl-lang {
    position: relative;

    --wlp-border: var(--border, rgb(255 255 255 / 0.12));
    --wlp-text: var(--text, #f3f5f7);
    --wlp-muted: var(--muted, #8a94a0);
    --wlp-surface: var(--surface, rgb(255 255 255 / 0.04));
    --wlp-panel: var(--bg, #0b0d10);
    --wlp-accent: var(--accent, #ccff00);
    --wlp-hover: rgb(0 0 0 / 0.05);
    --wlp-shadow: 0 24px 50px -20px rgb(15 23 42 / 0.35);
}

html.dark .wl-lang {
    --wlp-hover: rgb(255 255 255 / 0.06);
    --wlp-shadow: 0 24px 50px -20px rgb(0 0 0 / 0.85);
}

/* The icon helper lives in wallet.css; public pages need their own copy. */
.wl-lang .dt { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; flex: none; }
.wl-lang .dt > svg { width: 100%; height: 100%; display: block; }

.wl-lang__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 2.25rem;
    padding: 0 0.5rem 0 0.375rem;
    border: 1px solid var(--wlp-border);
    border-radius: 999px;
    background: transparent;
    color: var(--wlp-muted);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.wl-lang__btn:hover { color: var(--wlp-text); background: var(--wlp-hover); }
.wl-lang__btn .dt { width: 1.15rem; height: 1.15rem; }
.wl-lang__code { text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700; }
.wl-lang__caret { width: 0.85rem; height: 0.85rem; opacity: 0.7; }

.wl-lang__menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 60;
    width: 15rem;
    max-width: calc(100vw - 2rem);
    padding: 0.625rem;
    border: 1px solid var(--wlp-border);
    border-radius: 1rem;
    background: var(--wlp-panel);
    box-shadow: var(--wlp-shadow);
}

.wl-lang__menu[hidden] { display: none; }

.wl-lang__search-wrap { position: relative; margin-bottom: 0.5rem; }
.wl-lang__search-wrap .dt {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--wlp-muted);
    pointer-events: none;
}

.wl-lang__search {
    width: 100%;
    height: 2.5rem;
    padding: 0 0.75rem 0 2.25rem;
    border: 1px solid var(--wlp-border);
    border-radius: 0.625rem;
    background: var(--wlp-surface);
    color: var(--wlp-text);
    font: inherit;
    font-size: 0.875rem;
}

.wl-lang__search:focus { outline: none; border-color: var(--wlp-accent); }
.wl-lang__search::placeholder { color: var(--wlp-muted); }

.wl-flag {
    width: 1.25rem;
    height: 1.25rem;
    flex: none;
    border-radius: 50%;
    background-size: cover !important;
    background-position: center !important;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.18);
}

.wl-lang__btn .wl-flag { width: 1.35rem; height: 1.35rem; }

.wl-lang__list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    max-height: 16rem;
    overflow-y: auto;
}

.wl-lang__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: 100%;
    padding: 0.55rem 0.25rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--wlp-text);
    font: inherit;
    text-align: center;
    cursor: pointer;
}

.wl-lang__item .wl-flag { width: 1.5rem; height: 1.5rem; }
.wl-lang__item-code { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em; }
.wl-lang__item:hover { background: var(--wlp-hover); }
.wl-lang__item.is-active { background: color-mix(in srgb, var(--wlp-accent) 14%, transparent); color: var(--wlp-accent); }

/* `hidden` has to beat the flex display above, or search filters nothing. */
.wl-lang__item[hidden] { display: none !important; }
.wl-lang__empty { padding: 1rem; text-align: center; font-size: 0.8125rem; color: var(--wlp-muted); }

/* Auth shell: the picker rides opposite the brand mark, above the form. */
.auth-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2.75rem;
}

.auth-topbar .auth-brand { margin-bottom: 0; }

/* Neutralise the default Google Translate chrome */
.goog-te-banner-frame.skiptranslate,
iframe.skiptranslate,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.goog-te-gadget-icon,
.goog-te-balloon-frame,
#goog-gt-tt, .goog-tooltip, .goog-tooltip:hover,
.goog-te-spinner-pos { display: none !important; }

#google_translate_element { display: none !important; }

body { top: 0 !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
font[style] { background-color: transparent !important; box-shadow: none !important; }
