/*
 * TTF-016 Therapist matching: homepage banner + form page.
 *
 * Tokens are lifted from assets/css/therapist-contact.css so this reads as part
 * of the same site: amber #F5A623, page #f7f8fa, white cards at 12px radius,
 * inputs at 8px with an amber focus ring.
 *
 * Headings and buttons carry extra scoping because Elementor's kit stylesheet
 * (`.elementor-kit-12 button`, and its heading rules) outranks a bare class.
 */

/* =========================================================================
 * Banner  [ttf_matching_banner]
 * ====================================================================== */

.ttf-match-banner {
    display: block;
    margin: 0 auto;
    padding: 0;
}

.ttf-match-banner__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
    background: #F5C74F;
    border-radius: 14px;
    padding: 30px 34px;
}

.ttf-match-banner__copy {
    flex: 1 1 380px;
    min-width: 0;
}

.ttf-match-banner .ttf-match-banner__heading {
    margin: 0 0 8px !important;
    padding: 0;
    font-size: 23px !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;
    color: #1c1d1f !important;
    letter-spacing: -0.01em;
}

.ttf-match-banner .ttf-match-banner__text {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #3a3222;
    max-width: 62ch;
}

.ttf-match-banner .ttf-match-banner__cta {
    flex: 0 0 auto;
    display: inline-block;
    background: #1f2124;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    padding: 15px 28px;
    border-radius: 999px;
    white-space: nowrap;
    transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
    box-shadow: 0 2px 10px rgba(31, 33, 36, 0.18);
}

.ttf-match-banner .ttf-match-banner__cta:hover,
.ttf-match-banner .ttf-match-banner__cta:focus {
    background: #000;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(31, 33, 36, 0.26);
}

.ttf-match-banner .ttf-match-banner__cta:focus-visible {
    outline: 3px solid #1f2124;
    outline-offset: 3px;
}

@media (max-width: 780px) {
    .ttf-match-banner__inner {
        padding: 26px 22px;
        gap: 20px;
    }
    .ttf-match-banner .ttf-match-banner__heading { font-size: 21px !important; }
    .ttf-match-banner .ttf-match-banner__cta {
        width: 100%;
        text-align: center;
    }
}

/* =========================================================================
 * Form page  [ttf_matching_form]
 * ====================================================================== */

/* Hello Elementor prints the page title above the content. On this page that
   repeats the heading the form renders itself. The PHP drops it via
   hello_elementor_page_title; this covers themes without that filter. */
.ttf-matching-page .page-header { display: none; }

.ttf-match {
    max-width: 780px;
    margin: 0 auto;
    padding: 8px 0 48px;
    color: #1a1a1a;
}

.ttf-match__intro {
    text-align: center;
    margin-bottom: 30px;
}

.ttf-match .ttf-match__title {
    margin: 0 0 12px !important;
    padding: 0;
    font-size: 32px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    color: #111 !important;
    letter-spacing: -0.015em;
}

.ttf-match .ttf-match__lede {
    margin: 0 auto;
    max-width: 56ch;
    font-size: 16px;
    line-height: 1.65;
    color: #555;
}

/* ---- Notices ---- */

.ttf-match-notice {
    background: #fdebeb;
    border: 1px solid #f5c2c2;
    color: #8a2424;
    border-radius: 10px;
    padding: 13px 16px;
    font-size: 14.5px;
    line-height: 1.5;
    margin-bottom: 24px;
}

/* ---- Groups ---- */

.ttf-match-group {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    padding: 32px;
    margin-bottom: 22px;
}

.ttf-match .ttf-match-group__title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 26px !important;
    padding: 0 0 16px;
    border-bottom: 1px solid #eef0f2;
    font-size: 19px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    color: #111 !important;
}

.ttf-match-group__num {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fdf1dc;
    color: #a06a05;
    font-size: 14px;
    font-weight: 700;
}

.ttf-match .ttf-match-subhead {
    margin: 28px 0 14px !important;
    padding: 0;
    font-size: 16px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    color: #111 !important;
}

/* ---- Fields ---- */

.ttf-match-field {
    margin: 0 0 26px;
    padding: 0;
    border: 0;
    min-width: 0; /* fieldsets refuse to shrink in a grid without this */
}

.ttf-match-field:last-child { margin-bottom: 0; }

.ttf-match-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.ttf-match-field--half { max-width: 340px; }

.ttf-match .ttf-match-label {
    display: block;
    margin: 0 0 8px;
    padding: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    color: #262b30;
}

.ttf-match-req { color: #d0342c; }

.ttf-match-optional {
    font-weight: 500;
    font-size: 13px;
    color: #8b9198;
}

.ttf-match .ttf-match-hint {
    margin: -2px 0 12px;
    font-size: 13.5px;
    line-height: 1.55;
    color: #70767d;
}

.ttf-match-hint__count { color: #a06a05; font-weight: 600; }

.ttf-match input[type="text"],
.ttf-match input[type="email"],
.ttf-match input[type="tel"],
.ttf-match textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 15px;
    color: #222;
    background: #fff;
    border: 1px solid #d7dade;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ttf-match textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.ttf-match input[type="text"]:focus,
.ttf-match input[type="email"]:focus,
.ttf-match input[type="tel"]:focus,
.ttf-match textarea:focus {
    outline: none;
    border-color: #F5A623;
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

/* ---- Option cards (radio + checkbox) ----
 * Rendered as cards rather than bare inputs so the tap target on a phone is a
 * whole row instead of a 13px circle. */

.ttf-match-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ttf-match-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 220px;
    min-width: 0;
    padding: 13px 16px;
    background: #fff;
    border: 1px solid #d7dade;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14.5px;
    line-height: 1.45;
    color: #33383d;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.ttf-match-option:hover { border-color: #c2c7cd; background: #fcfcfd; }

.ttf-match-option input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #F5A623;
    cursor: pointer;
}

.ttf-match-option__label { min-width: 0; }

.ttf-match-option:has(input:checked) {
    border-color: #F5A623;
    background: #fffaf0;
    box-shadow: inset 0 0 0 1px #F5A623;
}

.ttf-match-option:has(input:focus-visible) {
    outline: 2px solid #F5A623;
    outline-offset: 2px;
}

/* Fallback for browsers without :has() — the input's own focus ring still
   shows, so the control stays usable, it just loses the filled card. */
.ttf-match-option input:focus-visible { outline: 2px solid #F5A623; outline-offset: 2px; }

/* Disabled while the visitor is at the three-topic cap. */
.ttf-match-option input:disabled { cursor: not-allowed; }
.ttf-match-option:has(input:disabled) {
    opacity: 0.45;
    cursor: not-allowed;
    background: #fafbfc;
}

.ttf-match-option--unsure {
    margin-top: 12px;
    flex: 0 1 auto;
    display: inline-flex;
    background: #f7f8fa;
}

/* =========================================================================
 * Topic picker
 *
 * The base markup is a native multi-select, which is compact and works with
 * no JavaScript. The combo below is what ttf-matching.js builds on top of it.
 * All 32 options as a checkbox grid reads fine on a desktop but stacks to
 * roughly 900px on a phone.
 * ====================================================================== */

.ttf-match-select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    font-family: inherit;
    font-size: 15px;
    color: #222;
    background: #fff;
    border: 1px solid #d7dade;
    border-radius: 8px;
}

.ttf-match-select--hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.ttf-match-hint--nojs { margin: 8px 0 0; }

.ttf-match-combo { position: relative; }
.ttf-match-combo.is-disabled { opacity: 0.45; pointer-events: none; }

/* ---- Chosen, as removable chips ---- */

.ttf-match-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px;
}

.ttf-match-chips[hidden] { display: none; }

.ttf-match-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px 7px 14px;
    background: #fffaf0;
    border: 1px solid #F5A623;
    box-shadow: inset 0 0 0 1px #F5A623;
    border-radius: 999px;
    font-size: 14px;
    line-height: 1.3;
    color: #6b4708;
}

/*
 * Scoped with .ttf-match on purpose. Elementor's kit stylesheet carries
 * `.elementor-kit-12 button` (0,1,1), which outranks a lone class and would
 * otherwise turn this into a full-size amber block button.
 */
.ttf-match .ttf-match-chip__remove {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 0;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(245, 166, 35, 0.22);
    color: #6b4708;
    font-family: inherit;
    font-size: 17px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    transition: background 0.15s ease;
}

.ttf-match .ttf-match-chip__remove:hover { background: rgba(245, 166, 35, 0.45); }
.ttf-match .ttf-match-chip__remove:focus-visible { outline: 2px solid #F5A623; outline-offset: 2px; }

/* ---- The search box ---- */

.ttf-match-combo__box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px 0 0;
    background: #fff;
    border: 1px solid #d7dade;
    border-radius: 8px;
    cursor: text;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ttf-match-combo.is-open .ttf-match-combo__box,
.ttf-match-combo__box:focus-within {
    border-color: #F5A623;
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

.ttf-match .ttf-match-combo__input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0 !important;
    background: transparent;
    padding: 13px 14px;
    font-family: inherit;
    font-size: 15px;
    color: #222;
}

.ttf-match .ttf-match-combo__input:focus {
    outline: none;
    box-shadow: none;
}

.ttf-match-combo__caret {
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #8b9198;
    transition: transform 0.15s ease;
}

.ttf-match-combo.is-open .ttf-match-combo__caret { transform: rotate(180deg); }

/* ---- The dropdown ---- */

.ttf-match-combo__list {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 290px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid #d7dade;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(16, 20, 24, 0.14);
}

.ttf-match-combo__list[hidden] { display: none; }

.ttf-match-combo__option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 11px 12px;
    border-radius: 7px;
    font-size: 14.5px;
    line-height: 1.4;
    color: #33383d;
    cursor: pointer;
}

.ttf-match-combo__option[hidden] { display: none; }
.ttf-match-combo__option:hover,
.ttf-match-combo__option.is-active { background: #f4f6f8; }

.ttf-match-combo__tick {
    flex: 0 0 auto;
    position: relative;
    width: 18px;
    height: 18px;
    border: 1px solid #c2c7cd;
    border-radius: 5px;
    background: #fff;
}

.ttf-match-combo__option.is-selected .ttf-match-combo__tick {
    background: #F5A623;
    border-color: #F5A623;
}

.ttf-match-combo__option.is-selected .ttf-match-combo__tick::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* At the cap, the unpicked options stay visible but read as unavailable. */
.ttf-match-combo__option.is-unavailable { opacity: 0.4; }

.ttf-match-combo__empty {
    padding: 14px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #70767d;
}

.ttf-match-combo__empty[hidden] { display: none; }

/* The count line flashes when someone tries to pick a fourth. */
@keyframes ttf-match-flash {
    0%, 100% { color: #a06a05; }
    35%      { color: #d0342c; }
}

.ttf-match-hint__count.is-flash { animation: ttf-match-flash 0.5s ease; }

@media (prefers-reduced-motion: reduce) {
    .ttf-match-hint__count.is-flash { animation: none; }
}

/* ---- Consent checkboxes ---- */

.ttf-match-field--check { margin-bottom: 16px; }

.ttf-match-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14.5px;
    line-height: 1.6;
    color: #33383d;
}

.ttf-match-check input {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    margin: 2px 0 0;
    accent-color: #F5A623;
    cursor: pointer;
}

/* ---- Invalid state ---- */

.ttf-match-field.is-invalid input[type="text"],
.ttf-match-field.is-invalid input[type="email"],
.ttf-match-field.is-invalid input[type="tel"],
.ttf-match-field.is-invalid textarea {
    border-color: #d0342c;
    background: #fff8f7;
}

.ttf-match-field.is-invalid .ttf-match-option { border-color: #e8a9a4; }

.ttf-match .ttf-match-error {
    margin: 8px 0 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: #d0342c;
    font-weight: 500;
}

/* ---- Important information ---- */

.ttf-match .ttf-match-group__title--plain {
    border-bottom: 1px solid #eef0f2;
}

.ttf-match-crisis {
    background: #eaf4f5;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 26px;
}

.ttf-match-crisis p {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.6;
    color: #2f5157;
}

.ttf-match-crisis p:last-child { margin-bottom: 0; }
.ttf-match-crisis strong { color: #0f5d68; }

.ttf-match-crisis a {
    color: #0f5d68;
    font-weight: 600;
    text-decoration: underline;
}

/* ---- Honeypot ---- */

.ttf-match-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---- Submit ---- */

.ttf-match .cf-turnstile { margin: 4px 0 20px; }

/* Scoped because Elementor's `.elementor-kit-12 button` (0,1,1) outranks a
   bare class and would otherwise impose its own padding and colour. */
.ttf-match .ttf-match-submit {
    display: block;
    width: 100%;
    padding: 16px 28px;
    border: none;
    border-radius: 10px;
    background: #F5A623;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.25);
}

.ttf-match .ttf-match-submit:hover {
    background: #e09510;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.35);
}

.ttf-match .ttf-match-submit:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.ttf-match .ttf-match-footnote {
    margin: 14px 0 0;
    text-align: center;
    font-size: 13px;
    line-height: 1.55;
    color: #8b9198;
}

/* ---- Small screens ---- */

@media (max-width: 680px) {
    .ttf-match { padding-bottom: 32px; }
    .ttf-match .ttf-match__title { font-size: 26px !important; }
    .ttf-match-group { padding: 24px 20px; border-radius: 10px; }
    .ttf-match-row { grid-template-columns: 1fr; gap: 0; }
    .ttf-match-row .ttf-match-field { margin-bottom: 22px; }
    .ttf-match-field--half { max-width: none; }
    .ttf-match-option { flex: 1 1 100%; }
    /* Roomier rows on a phone, and a taller panel since there is more screen
       below the box than beside it. */
    .ttf-match-combo__option { padding: 13px 12px; }
    .ttf-match-combo__list { max-height: 320px; }
}
