/*
 * Contact categories: the one-time notice in contact lists and the Set category drawer
 * (static/js/contact_categories.js; PLANS/PRESALES_PLAN.md, section 8.2).
 */

/* Holds the notice inside the contact list, inset from the list's edges like its buttons. */
.rsh-contacts-categories {
    padding: 0.5rem 0.75rem 0.25rem;
}

.rsh-contacts-categories:empty {
    display: none;
}

.contact-categories-notice {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid #bfdbfe;
    border-radius: 1rem;
    background: #eff6ff;
    color: #1d4f91;
}

.contact-categories-notice__text {
    margin: 0 0 0.5rem;
    font-size: 0.86rem;
    line-height: 1.45;
}

.contact-categories-notice__actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.contact-categories-notice__button {
    border: 0;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    background-image: linear-gradient(90deg, #2dd4bf, #43c8f7, #2dd4bf);
    background-size: 200% auto;
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

.contact-categories-notice__button:hover {
    background-position: right center;
}

.contact-categories-notice__link {
    border: 0;
    background: none;
    color: #1d4f91;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.contact-categories__help {
    margin: 0 0 0.75rem;
    color: #5f7494;
    font-size: 0.86rem;
    line-height: 1.45;
}

.contact-categories__tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.contact-categories__tab {
    border: 1px solid #dbe6f3;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    background: #ffffff;
    color: #3b4a63;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
}

.contact-categories__tab[aria-selected="true"] {
    border-color: #2dd4bf;
    background: #f0fdfa;
    color: #0f766e;
}

.contact-categories__list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 55vh;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.contact-categories__row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    /* The site's label rule adds a bottom margin; the list's gap does the spacing. */
    margin: 0;
    padding: 0.55rem 0.7rem;
    border: 1px solid #e3ebf5;
    border-radius: 0.85rem;
    cursor: pointer;
}

.contact-categories__name {
    flex: 1;
    color: #17233b;
    font-size: 0.9rem;
    font-weight: 600;
}

.contact-categories__pill {
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #f4f6fa;
    color: #647a9b;
    font-size: 0.76rem;
    font-weight: 700;
}

/* The site's checkbox (createCheckboxEl) with the contact's name as its text. */
.contact-categories__tick-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.contact-categories__tick-wrap .cbx {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    cursor: pointer;
}

/* The site's checkbox capitalizes its text; a contact's name is shown as typed. */
.contact-categories__tick-wrap .cbx span {
    text-transform: none;
}

.contact-categories__tick-wrap .cbx span:first-child {
    flex: 0 0 auto;
}

.contact-categories__tick-wrap .cbx .contact-categories__name {
    color: #17233b;
    font-size: 0.9rem;
    font-weight: 600;
}

[data-theme="dark"] .contact-categories__tick-wrap .cbx .contact-categories__name {
    color: #f8fbff;
}

.contact-categories__footer {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

/* site.css caps fields at 73vw (!important); in the drawer the category select fills the width. */
.contact-categories__footer .site-compact-input-underlined select {
    max-width: 100% !important;
}

/* The drawer's main button: the same size and gradient as E-Sign's primary buttons. */
.contact-categories__save {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.6rem;
    padding: 0.7rem 1.35rem;
    border: 0;
    border-radius: var(--button-border-radius, 10rem);
    background-image: var(--esign-primary-gradient-background, linear-gradient(90deg, #2dd4bf, #43c8f7, #2dd4bf));
    background-size: 200% auto;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-position 0.5s ease;
}

.contact-categories__save:hover {
    background-position: right center;
}

.contact-categories__more {
    align-self: center;
    margin-top: 0.25rem;
}

[data-theme="dark"] .contact-categories-notice {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
    color: #bae6fd;
}

[data-theme="dark"] .contact-categories-notice__link {
    color: #bae6fd;
}

[data-theme="dark"] .contact-categories__row,
[data-theme="dark"] .contact-categories__tab {
    background: #0d2232;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

[data-theme="dark"] .contact-categories__name {
    color: #f8fbff;
}

[data-theme="dark"] .contact-categories__help {
    color: rgba(226, 232, 240, 0.76);
}
