/* Country dropdown with SVG flags (US #675). All rules are under .daomainsite-auth. */

/* The native select stays in the form but is visually hidden */
.daomainsite-auth select.form__input.cs__native {
    position: absolute; left: 0; bottom: 0;
    width: 1px; height: 1px; padding: 0; margin: 0; border: 0;
    opacity: 0; pointer-events: none; background: none;
}
.daomainsite-auth .cs-host { position: relative; }

.daomainsite-auth .cs { position: relative; }

/* Button field */
.daomainsite-auth .cs__btn {
    display: flex; align-items: center; gap: 12px;
    width: 100%; height: 56px; padding: 0 44px 0 18px;
    border: 1px solid #DADDE5; border-radius: 8px; background: #fff;
    font: 500 16px/24px Montserrat, sans-serif; color: #000; text-align: left;
    cursor: pointer; position: relative;
    transition: border-color .3s, box-shadow .3s;
    -webkit-tap-highlight-color: transparent;
}
.daomainsite-auth .cs__btn:hover { border-color: #9A9CA5; }
.daomainsite-auth .cs__btn:focus { outline: 0; }
.daomainsite-auth .cs__btn:focus-visible,
.daomainsite-auth .cs.is-open .cs__btn {
    border-color: #FB5348; box-shadow: 0 0 0 3px rgba(251, 83, 72, .15);
}
.daomainsite-auth .has-error .cs__btn { border-color: #E5362B; }
.daomainsite-auth .cs__btn.is-empty .cs__text { color: #9A9CA5; }
.daomainsite-auth .cs__text { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.daomainsite-auth .cs__chev {
    position: absolute; right: 18px; top: 50%; width: 12px; height: 8px; margin-top: -4px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%239A9CA5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat center;
    transition: transform .2s;
}
.daomainsite-auth .cs.is-open .cs__chev { transform: rotate(180deg); }

/* Flag 4:3 (24x18) */
.daomainsite-auth .cs__flag {
    flex: 0 0 auto; display: inline-flex; width: 24px; height: 18px;
    border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .1);
    background: #F1F3F8;
}
.daomainsite-auth .cs__flag[hidden] { display: none; }
.daomainsite-auth .cs__flag img { display: block; width: 24px; height: 18px; object-fit: cover; }
.daomainsite-auth .cs__flag--none {
    background: #F1F3F8 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='18' viewBox='0 0 24 18'><g fill='none' stroke='%239A9CA5' stroke-width='1.2'><circle cx='12' cy='9' r='5.5'/><ellipse cx='12' cy='9' rx='2.4' ry='5.5'/><path d='M6.5 9h11'/></g></svg>") no-repeat center;
}

/* Dropdown panel (tablet and desktop) */
.daomainsite-auth .cs__pop {
    --cs-max: 380px;
    position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px);
    display: flex; flex-direction: column;
    max-height: calc(var(--cs-max) + 64px);
    background: #fff; border: 1px solid #DADDE5; border-radius: 12px;
    box-shadow: 0 14px 36px rgba(20, 22, 30, .16);
    overflow: hidden;
}
.daomainsite-auth .cs__pop[hidden] { display: none; }
.daomainsite-auth .cs.cs--up .cs__pop { top: auto; bottom: calc(100% + 6px); }
.daomainsite-auth .cs__head, .daomainsite-auth .cs__backdrop { display: none; }

.daomainsite-auth .cs__search { padding: 10px 10px 6px; border-bottom: 1px solid #F1F3F8; }
.daomainsite-auth .cs__search-input {
    display: block; width: 100%; height: 44px; padding: 0 14px 0 40px;
    border: 1px solid #DADDE5; border-radius: 8px; box-shadow: none;
    font: 500 16px/24px Montserrat, sans-serif; color: #000;
    background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><g fill='none' stroke='%239A9CA5' stroke-width='1.8' stroke-linecap='round'><circle cx='7' cy='7' r='5'/><path d='M11 11l3.5 3.5'/></g></svg>") no-repeat 14px center;
    -webkit-appearance: none; appearance: none;
}
.daomainsite-auth .cs__search-input::placeholder { color: #9A9CA5; opacity: 1; }
.daomainsite-auth .cs__search-input:focus { outline: 0; border-color: #FB5348; box-shadow: 0 0 0 3px rgba(251, 83, 72, .15); }

.daomainsite-auth .cs__list {
    flex: 1 1 auto; margin: 0; padding: 6px; list-style: none;
    max-height: var(--cs-max); overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.daomainsite-auth .cs__opt {
    display: flex; align-items: center; gap: 12px;
    min-height: 44px; margin: 0; padding: 0 12px; border-radius: 8px;
    font: 500 15px/20px Montserrat, sans-serif; color: #000; cursor: pointer;
}
.daomainsite-auth .cs__opt[hidden] { display: none; }
.daomainsite-auth .cs__opt.is-active { background: #F3F5FA; }
.daomainsite-auth .cs__opt.is-selected { background: #FFF1F0; font-weight: 700; }
.daomainsite-auth .cs__opt.is-selected.is-active { background: #FFE6E3; }
.daomainsite-auth .cs__name { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.daomainsite-auth .cs__vat {
    flex: 0 0 auto; padding: 2px 8px; border-radius: 10px;
    background: #F1F3F8; color: #595A5F; font: 600 11px/16px Montserrat, sans-serif; white-space: nowrap;
}
.daomainsite-auth .cs__opt.is-selected .cs__vat { background: #fff; }
.daomainsite-auth .cs__empty { padding: 20px 16px 24px; text-align: center; font: 500 14px/20px Montserrat, sans-serif; color: #9A9CA5; }
.daomainsite-auth .cs__empty[hidden] { display: none; }

/* Phone (<=599): bottom sheet. JS sets the height and bottom offset from visualViewport (the keyboard does not cover the list) */
@media (max-width: 599px) {
    .daomainsite-auth .cs__btn { height: 52px; }
    .daomainsite-auth .cs__backdrop {
        display: block; position: fixed; z-index: 100001; inset: 0;
        background: rgba(20, 22, 30, .45);
    }
    .daomainsite-auth .cs__backdrop[hidden] { display: none; }
    .daomainsite-auth .cs__pop {
        position: fixed; z-index: 100002; left: 0; right: 0; top: auto;
        bottom: var(--cs-bottom, 0px);
        height: min(560px, calc(var(--cs-vh, 100dvh) - 24px));
        max-height: none; border: 0; border-radius: 16px 16px 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -10px 40px rgba(20, 22, 30, .25);
        animation: cs-sheet .22s ease-out;
    }
    .daomainsite-auth .cs.cs--up .cs__pop { bottom: var(--cs-bottom, 0px); }
    .daomainsite-auth .cs__head {
        display: flex; align-items: center; justify-content: space-between;
        padding: 14px 8px 4px 20px;
    }
    .daomainsite-auth .cs__head-title { font: 800 14px/20px Montserrat, sans-serif; text-transform: uppercase; letter-spacing: .04em; color: #4C4E53; }
    .daomainsite-auth .cs__close {
        position: relative; width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .daomainsite-auth .cs__close::before, .daomainsite-auth .cs__close::after {
        content: ""; position: absolute; left: 14px; top: 21px; width: 16px; height: 2px;
        background: #595A5F; border-radius: 1px; transform: rotate(45deg);
    }
    .daomainsite-auth .cs__close::after { transform: rotate(-45deg); }
    .daomainsite-auth .cs__list { flex: 1 1 0; max-height: none; min-height: 0; }
    .daomainsite-auth .cs__opt { min-height: 48px; padding: 0 10px; gap: 10px; }
}
html.cs-lock, html.cs-lock body { overflow: hidden; }

@keyframes cs-sheet { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .daomainsite-auth .cs__pop { animation: none; }
    .daomainsite-auth .cs__chev, .daomainsite-auth .cs__btn { transition: none; }
}
