/* =====================================================================
   Custom Select (dropdown estilizado global)
   Base = visual moderno (profile / onboarding).
   Overrides por contexto para casar com os inputs de cada página.
   ===================================================================== */

.cs {
    position: relative;
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.cs__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.3;
    color: #0f172a;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.cs__toggle:hover {
    border-color: #b9cdec;
}

.cs.cs--open .cs__toggle {
    border-color: #0368ff;
    box-shadow: 0 0 0 3px rgba(3, 104, 255, 0.12);
}

.cs.cs--invalid .cs__toggle {
    border-color: #ff005c;
    box-shadow: 0 0 0 3px rgba(255, 0, 92, 0.12);
}

.cs__value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.cs.cs--placeholder .cs__value {
    color: #94a3b8;
    font-weight: 400;
}

.cs__arrow {
    flex-shrink: 0;
    color: #64748b;
    transition: transform 0.2s ease;
}

.cs.cs--open .cs__arrow {
    transform: rotate(180deg);
}

.cs__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid #e6edf6;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
    max-height: 280px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.cs.cs--open .cs__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cs__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.cs__option:hover {
    background: #f1f6ff;
    color: #0368ff;
}

.cs__option.is-selected {
    background: #eef4ff;
    color: #0368ff;
    font-weight: 600;
}

.cs__option.is-selected::after {
    content: "";
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M20 6L9 17l-5-5' stroke='%230368ff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.cs__option.is-disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

/* Scrollbar discreta do menu */
.cs__menu::-webkit-scrollbar {
    width: 8px;
}
.cs__menu::-webkit-scrollbar-thumb {
    background: #d7e0ee;
    border-radius: 8px;
}

/* ---------------------------------------------------------------------
   Overrides por contexto (o toggle imita os inputs vizinhos)
   --------------------------------------------------------------------- */

/* Card de candidatura (detalhes de vaga) — inputs usam float:left */
#formCandidatura .cs {
    float: left;
    clear: both;
    width: 100%;
    margin: 0 0 8px 0;
}
/* Mesma fonte entre inputs nativos e o toggle do dropdown */
#formCandidatura input:not([type="hidden"]),
#formCandidatura textarea,
#formCandidatura .cs__toggle,
#formCandidatura .cs__value {
    font-family: "Urbanist", sans-serif;
    font-size: 14px;
}
#formCandidatura .cs__toggle {
    border-radius: 4px;
    border: 1px solid #dce4f1;
    padding: 10px 8px;
    color: #6b879d;
    font-weight: 400;
}
#formCandidatura .cs .cs__value {
    font-weight: 400;
}
#formCandidatura .cs.cs--placeholder .cs__value {
    color: #6b879d;
    font-weight: 400;
}
/* Garante placeholder idêntico entre inputs nativos e o dropdown */
#formCandidatura input::placeholder,
#formCandidatura textarea::placeholder {
    color: #6b879d;
    opacity: 1;
    font-weight: 400;
}
#formCandidatura .cs.cs--open .cs__toggle,
#formCandidatura .cs__toggle:hover {
    border-color: #06f;
}

/* Profile (perfil profissional) */
.profile-page .cs {
    margin-bottom: 16px;
}

/* Onboarding candidato (evita zoom no iOS + altura maior) */
.ob-page.ob-candidato .cs__toggle {
    min-height: 48px;
    font-size: 16px;
}

/* Favoritos (empresa) */
.pf-filters__field .cs__toggle {
    padding: 8px 12px;
    border: 1px solid rgba(210, 218, 235, 0.4);
    border-radius: 8px;
    color: #2f3740;
}

/* Buscar profissionais (form principal + modal "Mais filtros") */
.bp-field .cs__toggle {
    padding: 10px 12px;
}

/* Artigos (editor) */
.artigo-editor-field .cs__toggle {
    font-size: 15px;
    border-color: #dbe3ef;
}
