/*
 * Language switcher (markup rendered by shared/i18n/i18n.js).
 * Same file in client5 and donor5. Round flag + caret, the word "Language"
 * underneath, and a menu of round flags. Pick a look with a modifier class:
 *   .language-switcher--dark      white text, for dark bars (client header, login backgrounds)
 *   .language-switcher--light     gray text, for white bars (donor header)
 *   .language-switcher--floating  pinned to the top-right corner of the page (login)
 */
.language-switcher {
    position: relative;
    display: flex;
    align-items: center;
    font-family: inherit;
}

.language-switcher .i18n-switcher__button {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 2px 6px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.2s ease, color 0.15s ease, background-color 0.15s ease;
}

.language-switcher .i18n-switcher__current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.language-switcher .i18n-switcher__flag {
    display: block;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.language-switcher .i18n-switcher__flag--none {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    font-size: 20px;
}

.language-switcher .i18n-switcher__caret {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.language-switcher.is-open .i18n-switcher__caret {
    transform: rotate(180deg);
}

.language-switcher .i18n-switcher__label {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.language-switcher .i18n-switcher__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: -8px;
    min-width: 210px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    text-align: left;
    z-index: 10000;
}

.language-switcher .i18n-switcher__menu[hidden] {
    display: none;
}

.language-switcher .i18n-switcher__option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin: 0;
    padding: 11px 20px;
    background: none;
    border: none;
    color: #2b2b2b;
    font-family: inherit;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}

.language-switcher .i18n-switcher__option .i18n-switcher__flag {
    width: 32px;
    height: 32px;
}

.language-switcher .i18n-switcher__option .i18n-switcher__flag--none {
    font-size: 26px;
    color: #6c757d;
}

.language-switcher .i18n-switcher__option:hover,
.language-switcher .i18n-switcher__option:focus-visible {
    background: #f1f5fb;
    outline: none;
}

.language-switcher .i18n-switcher__option.is-active {
    font-weight: 600;
}

/* Dark bars */
.language-switcher--dark .i18n-switcher__button {
    color: #ffffff;
}

.language-switcher--dark .i18n-switcher__button:hover {
    opacity: 0.8;
}

/* White bars */
.language-switcher--light .i18n-switcher__button {
    color: #6c757d;
}

.language-switcher--light .i18n-switcher__button:hover,
.language-switcher--light.is-open .i18n-switcher__button {
    color: #007bff;
}

/* Login pages */
.language-switcher--floating {
    position: fixed;
    top: 14px;
    right: 18px;
    z-index: 1000;
    /* A pill, so the control reads as one element wherever it lands. Without a
       background it straddled the corner of the login card — half the flag on
       white, half on the gradient — and looked broken. */
    background: rgba(17, 45, 78, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(4px);
}

/* Narrow screens: the card takes the width, so the chip drops the word and
   tucks into the corner as flag + caret. */
@media (max-width: 768px) {
    .language-switcher--floating {
        top: 10px;
        right: 10px;
    }

    .language-switcher--floating .i18n-switcher__label {
        display: none;
    }

    .language-switcher--floating .i18n-switcher__button {
        padding: 5px 8px;
    }
}

.language-switcher--floating .i18n-switcher__button {
    padding: 6px 10px;
}

.language-switcher--floating .i18n-switcher__button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.16);
}
