/* Netlinko – lists of countries and languages with flags and search (assets/picker.js),
   in the member space and in the admin. Colours follow the member space when present. */

.nl-picker {
	--nlp-line: #d3d9e6;
	--nlp-ink: var(--nl-ink, #0b1a2b);
	--nlp-muted: var(--nl-muted, #5b6b7c);
	--nlp-primary: var(--nl-primary, #0d2f4f);
	--nlp-soft: var(--nl-primary-50, #e8eef5);
	position: relative;
	width: 100%;
	max-width: 100%;
	font: inherit;
}
.nl-picker *, .nl-picker *::before, .nl-picker *::after { box-sizing: border-box; }

/* The select keeps the value; hidden from sight, still validated by the browser. */
.nl-picker .nl-picker__native {
	position: absolute !important; left: 0; bottom: 0; width: 100% !important; height: 1px !important; min-height: 0 !important;
	padding: 0 !important; margin: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; overflow: hidden;
}

.nl-picker__btn {
	display: flex; align-items: center; gap: .6em; width: 100%; min-height: 2.75em; margin: 0;
	padding: .55em 2.5em .55em .85em; border: 1px solid var(--nlp-line); border-radius: 10px;
	background: #fff; color: var(--nlp-ink); font: inherit; text-align: left; cursor: pointer; position: relative;
	transition: border-color .15s, box-shadow .15s;
}
.nl-picker__btn:hover { border-color: color-mix(in srgb, var(--nlp-primary) 45%, var(--nlp-line)); }
.nl-picker__btn:focus-visible, .nl-picker.is-open .nl-picker__btn { outline: none; border-color: var(--nlp-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--nlp-primary) 15%, transparent); }
.nl-picker.is-invalid .nl-picker__btn { border-color: var(--nl-red, #d42f2f); }
.nl-picker.is-disabled .nl-picker__btn { background: #f4f6f9; color: var(--nlp-muted); cursor: not-allowed; }
.nl-picker__text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nl-picker__text.is-placeholder { color: var(--nlp-muted); }
.nl-picker__chev {
	position: absolute; right: .95em; top: 50%; width: .5em; height: .5em;
	border-right: 2px solid var(--nlp-muted); border-bottom: 2px solid var(--nlp-muted);
	transform: translateY(-70%) rotate(45deg); transition: transform .15s;
}
.nl-picker.is-open .nl-picker__chev { transform: translateY(-25%) rotate(225deg); }

.nl-picker__flag { display: inline-grid; place-items: center; flex: none; width: 22px; height: 16px; }
.nl-picker__flag.is-empty { width: 0; }
.nl-picker__flag img { display: block; width: 22px; height: 16px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); }

.nl-picker__flag.is-swatch { width: 16px; }
.nl-picker__swatch { display: block; width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); }

/* The open list: a panel of its own (background, border, shadow), above the page, as wide as
   its longest choice within the screen (picker.js turns it to the right edge when needed). */
.nl-picker__pop {
	position: absolute; z-index: 1000; left: 0; right: auto; top: calc(100% + 6px);
	width: max-content; min-width: 100%; max-width: min(380px, calc(100vw - 24px));
	padding: .4em; border: 1px solid var(--nlp-line); border-radius: 12px; background: #fff;
	box-shadow: 0 12px 40px rgba(16, 24, 64, .18), 0 2px 6px rgba(16, 24, 64, .06);
}
.nl-picker.is-end .nl-picker__pop { left: auto; right: 0; }
.nl-picker.is-up .nl-picker__pop { top: auto; bottom: calc(100% + 6px); }
.nl-picker__pop[hidden] { display: none; }
.nl-picker .nl-picker__search {
	display: block; width: 100%; min-height: 2.5em; margin: 0 0 .35em; padding: .5em .8em .5em 2.2em;
	border: 1px solid var(--nlp-line); border-radius: 8px; font: inherit; font-size: .92rem; color: var(--nlp-ink);
	background: #f7f9fc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6b7c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat .7em 50% / 1em;
	box-shadow: none;
}
.nl-picker .nl-picker__search[hidden] { display: none; }
.nl-picker .nl-picker__search:focus { outline: none; border-color: var(--nlp-primary); background-color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--nlp-primary) 12%, transparent); }
.nl-picker__list { max-height: min(300px, 50vh); overflow-x: hidden; overflow-y: auto; margin: 0; padding: 0; list-style: none; outline: none; overscroll-behavior: contain; scrollbar-width: thin; }
.nl-picker__opt { display: flex; align-items: center; gap: .6em; margin: 0; padding: .5em .65em; border-radius: 8px; color: var(--nlp-ink); font-size: .93rem; line-height: 1.3; cursor: pointer; }
.nl-picker__opt[hidden] { display: none; }
.nl-picker__opt.is-active, .nl-picker__opt:hover { background: var(--nlp-soft); }
.nl-picker__opt[aria-selected="true"] { font-weight: 700; }
.nl-picker__opt[aria-selected="true"]::after { content: ""; margin-left: auto; width: .35em; height: .7em; border-right: 2px solid var(--nlp-primary); border-bottom: 2px solid var(--nlp-primary); transform: rotate(45deg) translate(-2px, -2px); flex: none; }
.nl-picker__opt[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.nl-picker__label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.nl-picker__none { margin: .4em .6em .5em; color: var(--nlp-muted); font-size: .9rem; }

/* Several choices: a box to tick before each one, the count and « Tout décocher » under the list. */
.nl-picker--multi .nl-picker__opt::before {
	content: ""; flex: none; width: 1.05em; height: 1.05em; border: 1.5px solid #9aa6b8; border-radius: 4px; background: #fff;
}
.nl-picker--multi .nl-picker__opt[aria-selected="true"]::before {
	border-color: var(--nlp-primary);
	background: var(--nlp-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 8.5 3 3 6-7'/%3E%3C/svg%3E") no-repeat center / 80%;
}
.nl-picker--multi .nl-picker__opt[aria-selected="true"] { background: var(--nlp-soft); }
.nl-picker--multi .nl-picker__opt[aria-selected="true"]::after { content: none; }
.nl-picker__foot { display: flex; align-items: center; justify-content: space-between; gap: .6em; margin: .35em 0 0; padding: .45em .5em .1em; border-top: 1px solid var(--nlp-line); font-size: .85rem; color: var(--nlp-muted); }
.nl-picker__clear { padding: .25em .55em; border: 0; border-radius: 6px; background: none; color: var(--nlp-primary); font: inherit; font-weight: 600; cursor: pointer; }
.nl-picker__clear:hover { background: var(--nlp-soft); }
.nl-picker__clear:disabled { color: var(--nlp-muted); cursor: default; background: none; }

/* Phones: a larger list, easy to touch. */
@media (max-width: 600px) {
	.nl-picker__pop { max-width: calc(100vw - 16px); }
	.nl-picker__opt { padding: .7em .7em; font-size: 1rem; }
	.nl-picker .nl-picker__search { font-size: 16px; }
	.nl-picker__list { max-height: 45vh; }
}
