/**
 * Search for an association by name — shared by the search on the new website (hero variant)
 * and the registration pages (form variant). See
 * resources/views/partials/association-search.blade.php (DEV-1226).
 */

.assoc-search {
    position: relative;
}

.assoc-search--hero {
    max-width: 560px;
    margin: 0 auto;
}

.assoc-search--hero .assoc-search__input {
    width: 100%;
    height: 54px;
    border-radius: 300px;
    border: none;
    padding: 0 54px 0 22px;
    font-size: 16px;
    font-family: inherit;
    color: #0f2248;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    outline: none;
    box-sizing: border-box;
}

.assoc-search--hero .assoc-search__input::placeholder {
    color: rgba(15, 34, 72, 0.45);
}

.assoc-search__btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #31708e;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.assoc-search__btn:hover {
    background: #255970;
}

.assoc-search__btn svg {
    fill: none;
    stroke: #fff;
}

/* The form variant sits in a normal form group, so the field keeps the app's input styling
   and only the list below it is ours. */
.assoc-search--form {
    display: flex;
    flex-direction: column;
}

.assoc-search__results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(15, 34, 72, 0.16);
    overflow: hidden;
    z-index: 200;
    display: none;
}

.assoc-search--form .assoc-search__results {
    top: 100%;
    max-height: 260px;
    overflow-y: auto;
}

.assoc-search__results.show {
    display: block;
}

.assoc-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 18px;
    cursor: pointer;
    text-decoration: none;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(15, 34, 72, 0.06);
    text-align: left;
    transition: background 0.15s;
}

.assoc-search-result:last-child {
    border-bottom: none;
}

.assoc-search-result:hover,
.assoc-search-result:focus {
    background: rgba(49, 112, 142, 0.06);
}

.assoc-search-result__name {
    font-size: 14px;
    font-weight: 500;
    color: #0f2248;
}

/* The municipality tells two associations of the same name apart. */
.assoc-search-result__base {
    font-size: 13px;
    color: rgba(15, 34, 72, 0.45);
    margin-left: 8px;
    white-space: nowrap;
}

.assoc-search-result__arrow {
    color: rgba(15, 34, 72, 0.3);
    font-size: 16px;
    margin-left: 8px;
    flex-shrink: 0;
}

.assoc-search-empty {
    padding: 16px 18px;
    font-size: 14px;
    color: rgba(15, 34, 72, 0.45);
    text-align: center;
}
