/* =========================================================
   SPECIALTY SELECTION (Step 1 — "What kind of care are you looking for?")
   Page chrome (banner, header, stepper, phase panel, footer) comes from
   SelfSchedulingLayout / self-scheduling.css. Everything here styles the
   content panel: search, the full specialty list, and the care-area cards.
   Color tokens (--ss-*) are inherited from .ss-shell.
   ========================================================= */

/* =========================================================
   SEARCH
   ========================================================= */
.spec-search {
    position: relative;
    margin-bottom: 22px;
}

.spec-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #cbd2df;
    border-radius: 8px;
    background: var(--ss-card-bg);
    transition: border-color .15s ease, box-shadow .15s ease;
}

    .spec-search-box.is-open,
    .spec-search-box:focus-within {
        border-color: var(--ss-primary);
        box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
    }

.spec-search-icon {
    flex: 0 0 auto;
    color: #98a2b3;
}

.spec-search-input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    color: var(--ss-text);
}

    .spec-search-input::placeholder {
        color: #98a2b3;
    }

.spec-search-panel {
    position: absolute;
    z-index: 60;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--ss-card-bg);
    border: 1px solid #e2e6ee;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.14);
    overflow: hidden;
    padding: 6px;
}

.spec-sugg {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    font-family: inherit;
}

    .spec-sugg.is-active,
    .spec-sugg:hover {
        background: #f4f7fe;
    }

.spec-sugg-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--ss-text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spec-sugg-hint {
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--ss-text-secondary);
}

.spec-sugg-tag {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    color: #3a4a7a;
    background: #eef1f8;
    border-radius: 999px;
    padding: 3px 12px;
}

.spec-search-foot {
    margin: 4px 0 2px;
    padding: 12px 14px 6px;
    border-top: 1px solid var(--ss-divider-subtle);
    font-size: 14px;
    color: var(--ss-text-secondary);
}

    .spec-search-foot a {
        color: var(--ss-primary);
        font-weight: 600;
        text-decoration: none;
    }

        .spec-search-foot a:hover {
            text-decoration: underline;
        }

.spec-search-empty {
    padding: 12px 14px;
}

.spec-search-empty-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ss-text);
}

.spec-search-empty-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ss-text-secondary);
}

    .spec-search-empty-text a {
        color: var(--ss-primary);
        font-weight: 600;
        text-decoration: none;
    }

        .spec-search-empty-text a:hover {
            text-decoration: underline;
        }

/* Specialty picked from search, shown under the search box */
.spec-pick {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    padding: 14px 18px;
    border: 1.5px solid var(--ss-header-navy);
    border-radius: 10px;
    background: #f7f8fc;
}

.spec-pick-check {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2f7d4f;
    color: #fff;
}

.spec-pick-body {
    flex: 1 1 auto;
    min-width: 0;
}

.spec-pick-title {
    margin: 0 0 2px;
    font-size: 16px;
    color: var(--ss-header-navy);
}

.spec-pick-name {
    font-weight: 700;
}

.spec-pick-clinical {
    color: var(--ss-text-secondary);
}

.spec-pick-meta {
    margin: 0;
    font-size: 14px;
    color: var(--ss-text-secondary);
}

.spec-pick-change {
    flex: 0 0 auto;
    padding: 8px 18px;
    border: 1px solid var(--ss-header-navy);
    border-radius: 8px;
    background: var(--ss-card-bg);
    color: var(--ss-header-navy);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

    .spec-pick-change:hover {
        background: #eef1f8;
    }

/* =========================================================
   BOOK WITH YOUR CARE TEAM
   ========================================================= */
.spec-careteam {
    margin-bottom: 28px;
}

.spec-careteam-heading {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ss-text);
}

.spec-careteam-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.spec-careteam-card {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 320px;
    min-width: 280px;
    max-width: 420px;
    padding: 16px 18px;
    box-sizing: border-box;
    border: 1px solid #E0E4F5;
    border-radius: 10px;
    background: #EFF1FC;
}

.spec-careteam-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.spec-careteam-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--ss-text);
}

.spec-careteam-meta {
    font-size: 14px;
    color: var(--ss-text-secondary);
}

.spec-careteam-link {
    align-self: flex-start;
    margin-top: 4px;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--ss-primary);
}

    .spec-careteam-link:hover {
        text-decoration: underline;
    }

.spec-ct-lastvisit {
    margin: 14px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ss-text);
}

/* =========================================================
   FULL SPECIALTY LIST
   ========================================================= */
.spec-listrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.spec-listrow-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--ss-text);
}

.spec-listrow-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: none;
    padding: 4px 2px;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--ss-primary);
}

    .spec-listrow-link:hover {
        text-decoration: underline;
    }

    .spec-listrow-link svg {
        transition: transform .18s ease;
    }

    .spec-listrow-link.is-open svg {
        transform: rotate(180deg);
    }

.spec-fulllist {
    list-style: none;
    margin: 0 0 20px;
    padding: 16px 8px;
    border: 1px solid var(--ss-border);
    border-radius: 10px;
    background: #fbfcfe;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px 12px;
}

.spec-fulllist-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    border-radius: 6px;
    padding: 9px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    color: var(--ss-text);
}

    .spec-fulllist-item:hover {
        background: #eef2fb;
    }

    .spec-fulllist-item:focus-visible {
        outline: 2px solid var(--ss-primary);
        outline-offset: 1px;
    }

    .spec-fulllist-item.is-selected {
        background: #e7edfb;
        color: var(--ss-primary);
        font-weight: 600;
    }

/* =========================================================
   BROWSE BY CARE AREA
   ========================================================= */
.spec-browse-heading {
    margin: 4px 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ss-border);
    font-size: 15px;
    font-weight: 600;
    color: var(--ss-text);
}

.spec-browse {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.spec-row-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Column gap matches the 16px between sibling cards so the two paired groups'
       cards sit evenly across the row (e.g. Lungs & Breathing → Diabetes). */
    gap: 20px 16px;
    align-items: stretch;
}

.spec-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.spec-group-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
    color: #16264f;
}

.spec-group-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    /* color + background are set per care area from the TOS-30 palette (inline). */
    color: #5f6b8f;
}

    .spec-group-icon svg {
        width: 22px;
        height: 22px;
    }

.spec-group-title {
    min-width: 0;
}

.spec-group-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--ss-text-secondary);
}

.spec-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

/* Two-card groups sit two-per-row, so their cards are half the column width
   — same card width as the four-across full-width rows. Fill the column so
   both paired groups' cards share the taller group's height. */
.spec-row-split .spec-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 1 1 auto;
    grid-auto-rows: 1fr;
}

/* =========================================================
   SPECIALTY CARD
   ========================================================= */
.spec-card {
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 4px;
    min-height: 150px;
    padding: 16px 16px 14px;
    border: 1.5px solid #d9dce3;
    border-radius: 12px;
    background: var(--ss-card-bg);
    cursor: pointer;
    font-family: inherit;
    /* Only border/shadow animate — never size — so selecting can't nudge neighbours. */
    transition: border-color .15s ease, box-shadow .15s ease, background-color .1s ease;
}

/* Hover only where a real pointer exists, so a tap on touch doesn't stick. */
@media (hover: hover) {
    .spec-card:hover {
        border-color: #aab8e0;
        box-shadow: 0 6px 16px rgba(17, 24, 39, 0.09);
    }

    .spec-card.is-selected:hover {
        border-color: #12234d;
    }
}

/* Focus ring — visually distinct from the hover border, and shown together
   with the selected treatment when a card is both focused and selected. */
.spec-card:focus-visible {
    outline: 2px solid var(--ss-primary);
    outline-offset: 2px;
}

/* Pressed: pressed fill, shadow removed. */
.spec-card:active {
    background: #eef1f8;
    box-shadow: none;
}

/* Selected: heavier, darker border + checkmark. Both carry in greyscale.
   box-sizing:border-box keeps the outer size fixed as the border thickens. */
.spec-card.is-selected {
    border-width: 2.5px;
    border-color: #12234d;
    background: var(--ss-card-bg);
}

.spec-card-check {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #12234d;
    color: #fff;
}

.spec-card.is-selected .spec-card-check {
    display: inline-flex;
}

.spec-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    color: #16264f;
    padding-right: 24px;
}

.spec-card-clinical {
    font-size: 13px;
    color: var(--ss-text-secondary);
    margin-bottom: 8px;
}

.spec-card-conditions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    /* Sit directly under the clinical name (top-aligned); shorter cards keep
       their empty space at the bottom, matching the design. */
    margin-top: 0;
}

.spec-card-condition {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 7px;
    background: #eef1f8;
    color: #3a4a7a;
    font-size: 14px;
    line-height: 1.3;
}

/* =========================================================
   FOOTNOTE
   ========================================================= */
.spec-footnote {
    margin: 28px 0 4px;
    padding-top: 16px;
    border-top: 1px solid var(--ss-divider-subtle);
    font-size: 13px;
    font-style: italic;
    color: var(--ss-text-secondary);
    line-height: 1.5;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
    .spec-fulllist {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    /* Stack paired groups; cards drop to two across everywhere. */
    .spec-row-split {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .spec-cards,
    .spec-row-split .spec-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .spec-fulllist {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .spec-listrow {
        flex-wrap: wrap;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .spec-cards,
    .spec-row-split .spec-cards {
        grid-template-columns: 1fr;
    }

    .spec-fulllist {
        grid-template-columns: 1fr;
    }

    .spec-card {
        min-height: 0;
    }

    .spec-sugg {
        gap: 8px;
    }
}
