/* ==========================================================================
   HTS forms & confirmation page (Contact, OMHC, PRP, Confirm)

   The template sets html { font-size: 10px }, so Bootstrap's rem-based
   form controls, alerts and .small text render ~60% size. Everything in
   this file uses px on purpose so it is not affected by that.
   Headings also get explicit sizes because the template scales h1-h3 up
   to 96px / 44px / 33px on wide screens.
   ========================================================================== */

:root {
    --hts-primary: #1298c1;
    --hts-primary-dark: #0e7fa2;
    --hts-teal: #049c9c;
    --hts-mint: #7dd4b8;
    --hts-ink: #272725;
    --hts-text: #4a4f55;
    --hts-muted: #6b7178;
    --hts-border: #d5dbe0;
    --hts-border-soft: #e5e7e9;
    --hts-surface: #f6f8fa;
    --hts-danger: #c0392b;
}

/* ---------- Page band + card --------------------------------------------- */

.hts-band {
    background: linear-gradient(180deg, var(--hts-surface) 0%, #fff 100%);
    padding: 60px 0 80px;
}

/* Links such as /referral-form/omhc#referral open the page at the band: leave room for the
   sticky header (81px on desktop, 56px on phones) above the card. */
.hts-band[id] {
    scroll-margin-top: 40px;
}

.hts-card {
    background: #fff;
    border: 1px solid var(--hts-border-soft);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(18, 152, 193, .08);
    padding: 40px;
}

@media (max-width: 767px) {
    .hts-band { padding: 36px 0 56px; }
    .hts-card { padding: 24px 18px; border-radius: 12px; }
}

/* ---------- Form header --------------------------------------------------- */

.hts-form-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 28px;
}

.hts-eyebrow {
    display: inline-block;
    font: 700 12px/1 Karla, sans-serif;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--hts-teal);
    background: rgba(125, 212, 184, .2);
    padding: 7px 12px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.hts-form-header h2,
.hts-form-header .hts-title {
    font: 700 32px/1.2 Karla, sans-serif !important;
    letter-spacing: 0 !important;
    color: var(--hts-ink);
    margin: 0 0 10px !important;
}

.hts-form-header p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--hts-text);
    margin: 0;
}

.hts-form-header .hts-required-hint,
.hts-required-hint {
    font-size: 13px;
    color: var(--hts-muted);
    margin-top: 8px;
}

.hts-req {
    color: var(--hts-danger);
    margin-left: 2px;
}

/* Cross-links on the referral form pages (program page / the other referral form) */
.hts-form-links a {
    color: var(--hts-primary-dark);
    text-decoration: underline;
}

@media (max-width: 575px) {
    .hts-form-header h2,
    .hts-form-header .hts-title { font-size: 26px !important; }

    /* One link per line instead of a separator dot left hanging at the end of the first line */
    .hts-form-links a { display: block; padding: 3px 0; }
    .hts-form-links span { display: none; }
}

/* ---------- Sections ------------------------------------------------------ */

.hts-section {
    border-top: 1px solid var(--hts-border-soft);
    padding: 28px 0 8px;
    margin: 0;
}

.hts-section:first-of-type,
.hts-section.hts-section--first {
    border-top: 0;
    padding-top: 4px;
}

.hts-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font: 700 20px/1.3 Karla, sans-serif !important;
    letter-spacing: 0 !important;
    color: var(--hts-ink);
    margin: 0 0 6px !important;
}

.hts-section-num {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--hts-primary-dark);
    color: #fff;
    font: 700 15px/1 Karla, sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hts-section-desc {
    font-size: 14px;
    line-height: 1.55;
    color: var(--hts-muted);
    margin: 0 0 18px 44px;
}

.hts-subtitle {
    font: 700 16px/1.4 Karla, sans-serif !important;
    letter-spacing: 0 !important;
    color: var(--hts-ink);
    margin: 18px 0 10px !important;
}

@media (max-width: 575px) {
    .hts-section-desc { margin-left: 0; }
}

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

.hts-form .form-group {
    margin-bottom: 18px;
}

.hts-form label.control-label,
.hts-form .hts-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--hts-ink);
    margin: 0 0 6px;
}

.hts-form .form-control,
.hts-form select,
.hts-form textarea {
    display: block;
    width: 100%;
    height: 46px;
    padding: 10px 14px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--hts-ink);
    background-color: #fff;
    border: 1px solid var(--hts-border);
    border-radius: 8px;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.hts-form textarea,
.hts-form textarea.form-control {
    height: auto;
    min-height: 130px;
    resize: vertical;
}

.hts-form select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236b7178' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    cursor: pointer;
}

.hts-form .form-control::placeholder,
.hts-form textarea::placeholder {
    color: #9aa1a8;
    opacity: 1;
}

.hts-form .form-control:focus,
.hts-form select:focus,
.hts-form textarea:focus {
    border-color: var(--hts-primary);
    box-shadow: 0 0 0 3px rgba(18, 152, 193, .18);
    outline: 0;
}

.hts-form .input-validation-error,
.hts-form .input-validation-error:focus {
    border-color: var(--hts-danger) !important;
}

.hts-form .input-validation-error:focus {
    box-shadow: 0 0 0 3px rgba(192, 57, 43, .15);
}

.hts-form .field-validation-error {
    display: block;
    font-size: 13px;
    line-height: 1.4;
    color: var(--hts-danger);
    margin-top: 6px;
}

.hts-form .field-validation-valid {
    display: none;
}

.hts-help {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    color: var(--hts-muted);
    margin-top: 6px;
}

.hts-counter {
    font-size: 12.5px;
    color: var(--hts-muted);
    text-align: right;
    margin-top: 4px;
}

/* ---------- Checkboxes ---------------------------------------------------- */

.hts-form .form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    position: relative;
    padding: 9px 12px;
    margin: 0 0 6px;
    border-radius: 8px;
    transition: background-color .15s ease;
}

.hts-form .form-check:hover {
    background-color: var(--hts-surface);
}

.hts-form .form-check input[type=checkbox] {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    position: static;
    accent-color: var(--hts-primary);
    cursor: pointer;
}

.hts-form .form-check-label {
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--hts-text);
    margin: 0;
    cursor: pointer;
}

.hts-form .form-check input[type=checkbox]:checked + .form-check-label {
    color: var(--hts-ink);
    font-weight: 600;
}

.hts-form .form-check input[type=checkbox]:focus-visible {
    outline: 3px solid #2b6cb0;
    outline-offset: 2px;
}

.hts-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 16px;
    margin-bottom: 12px;
}

.hts-check-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hts-check-grid .form-check,
.hts-check-grid .form-group {
    margin-bottom: 0;
}

@media (max-width: 991px) {
    .hts-check-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .hts-check-grid,
    .hts-check-grid--3 { grid-template-columns: 1fr; }
}

/* ---------- Read-only info (e.g. PRP referral source) --------------------- */

.hts-dl {
    display: grid;
    grid-template-columns: minmax(160px, 260px) 1fr;
    gap: 10px 20px;
    margin: 0 0 14px;
    font-size: 14.5px;
    line-height: 1.5;
}

.hts-dl dt {
    font-weight: 600;
    color: var(--hts-ink);
}

.hts-dl dd {
    margin: 0;
    color: var(--hts-text);
}

@media (max-width: 575px) {
    .hts-dl { grid-template-columns: 1fr; gap: 2px; }
    .hts-dl dd { margin-bottom: 10px; }
}

/* ---------- Validation summary ------------------------------------------- */

.hts-form .validation-summary-valid {
    display: none !important;
}

.hts-form .validation-summary-errors {
    display: block;
    background: #fdf1f0;
    border: 1px solid #f3c7c2;
    border-left: 4px solid var(--hts-danger);
    border-radius: 8px;
    padding: 14px 18px;
    margin: 0 0 24px;
    color: #7a1f15;
    font-size: 14px;
    line-height: 1.5;
}

.hts-form .validation-summary-errors::before {
    content: "Please correct the highlighted fields:";
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.hts-form .validation-summary-errors ul {
    margin: 0;
    padding-left: 18px;
}

.hts-form .validation-summary-errors li {
    list-style: disc;
    margin: 2px 0;
}

/* ---------- Crisis notice (_CrisisNotice) --------------------------------- */

.hts-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff8e8;
    border: 1px solid #f5dfa6;
    border-left: 4px solid #e0a526;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 0 0 24px;
    color: #5b4508;
    font-size: 14px;
    line-height: 1.55;
    text-align: left;
}

.hts-notice__icon {
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1.2;
    color: #c98a06;
}

.hts-notice strong {
    color: #3f3005;
}

.hts-notice a {
    color: #5b4508;
    font-weight: 700;
    text-decoration: underline;
}

/* Calm informational variant (_CustodyNotice, above the parent / guardian fields) */
.hts-notice--info {
    background: #eef7fb;
    border-color: #cde5ef;
    border-left-color: var(--hts-primary-dark);
    margin: 12px 0 16px;
    color: #1f4756;
}

.hts-notice--info .hts-notice__icon {
    color: var(--hts-primary-dark);
}

/* ---------- Privacy + accreditation (_FormPrivacyNotice) ------------------ */

.hts-trust {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 28px;
    padding: 16px 20px;
    margin: 12px 0 24px;
    background: var(--hts-surface);
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--hts-muted);
}

.hts-trust__item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 260px;
    margin: 0;
}

.hts-trust__icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e3f3f8;
    color: var(--hts-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.hts-trust img.hts-trust__badge {
    flex: 0 0 48px;
    width: 48px !important;
    height: 48px !important;
    max-width: none;
    object-fit: contain;
}

.hts-trust a {
    color: var(--hts-primary);
    text-decoration: underline;
}

/* ---------- Buttons ------------------------------------------------------- */

.hts-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
}

.hts-actions__note {
    font-size: 13px;
    color: var(--hts-muted);
    margin: 0;
}

.hts-submit,
a.hts-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 240px;
    height: 52px;
    padding: 0 32px;
    border: 0;
    border-radius: 8px;
    background: var(--hts-primary-dark); /* #0e7fa2: 4.6:1 with white text (WCAG AA) */
    color: #fff !important;
    font: 700 16px/1 Karla, sans-serif;
    letter-spacing: .02em;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(18, 152, 193, .25);
    transition: background-color .2s ease, box-shadow .2s ease, transform .1s ease;
}

.hts-submit:hover,
.hts-submit:focus {
    background: #0b6a87;
    box-shadow: 0 8px 20px rgba(4, 156, 156, .28);
}

.hts-submit:focus-visible,
.hts-btn-outline:focus-visible {
    outline: 3px solid #2b6cb0;
    outline-offset: 2px;
}

.hts-submit:active {
    transform: translateY(1px);
}

.hts-submit[disabled] {
    opacity: .75;
    cursor: progress;
}

.hts-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    padding: 0 26px;
    border: 2px solid var(--hts-primary-dark);
    border-radius: 8px;
    background: #fff;
    color: var(--hts-primary-dark) !important; /* 4.6:1 on white, like .hts-submit */
    font: 700 16px/1 Karla, sans-serif;
    text-decoration: none !important;
    transition: background-color .2s ease, color .2s ease;
}

.hts-btn-outline:hover,
.hts-btn-outline:focus {
    background: var(--hts-primary-dark);
    color: #fff !important;
}

@media (max-width: 575px) {
    .hts-submit,
    a.hts-submit,
    .hts-btn-outline { width: 100%; min-width: 0; }
}

/* Compact button for page copy, e.g. the "referral form" button under a program page heading */
.hts-submit--inline,
a.hts-submit--inline {
    min-width: 0;
    height: 44px;
    padding: 0 22px;
    font-size: 15px;
}

/* Sits between the program page heading and the photo / intro text row */
.hts-intro-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin: 20px 0 28px;
}

.hts-intro-actions__note {
    font-size: 14px;
    line-height: 1.5;
    color: var(--hts-muted);
    margin: 0;
}

/* ---------- Referral form entry points ------------------------------------
   The referral forms have their own pages (/referral-form/omhc, /referral-form/prp).
   .hts-cta is the band on the program pages (_ReferralCta); .hts-choice-* is the
   two-card chooser at /referral-form. */

.hts-cta__card {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}

.hts-cta__title {
    font: 700 30px/1.25 Karla, sans-serif !important;
    letter-spacing: 0 !important;
    color: var(--hts-ink);
    margin: 0 0 10px !important;
}

.hts-cta__text {
    font-size: 16px;
    line-height: 1.6;
    color: var(--hts-text);
    max-width: 600px;
    margin: 0 auto 24px;
}

.hts-cta__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.hts-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    max-width: 960px;
    margin: 0 auto;
}

.hts-choice-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--hts-border-soft);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(18, 152, 193, .08);
    padding: 32px;
    text-align: left;
}

.hts-choice-card__icon {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #e3f3f8;
    color: var(--hts-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.hts-choice-card__title {
    font: 700 24px/1.25 Karla, sans-serif !important;
    letter-spacing: 0 !important;
    color: var(--hts-ink);
    margin: 0 0 8px !important;
}

.hts-choice-card__text {
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--hts-text);
    margin: 0 0 14px;
}

.hts-choice-card__who {
    align-self: stretch;
    background: var(--hts-surface);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--hts-text);
}

.hts-choice-card__who strong {
    display: block;
    color: var(--hts-ink);
}

/* Buttons line up at the bottom of both cards whatever the text length */
.hts-choice-card .hts-submit {
    align-self: stretch;
    min-width: 0;
    margin-top: auto;
}

/* Phone fallback under the cards */
.hts-choice-foot {
    max-width: 960px;
    margin: 24px auto 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--hts-text);
    text-align: center;
}

.hts-choice-foot a {
    color: var(--hts-primary-dark);
    font-weight: 700;
    text-decoration: underline;
}

@media (max-width: 767px) {
    .hts-cta__title { font-size: 26px !important; }
    .hts-choice-grid { grid-template-columns: 1fr; gap: 16px; }
    .hts-choice-card { padding: 24px 18px; border-radius: 12px; }
    .hts-choice-card__title { font-size: 22px !important; }
}

/* ---------- Contact page -------------------------------------------------- */

.hts-contact-intro h2 {
    font: 700 30px/1.25 Karla, sans-serif !important;
    letter-spacing: 0 !important;
    color: var(--hts-ink);
    margin: 0 0 10px !important;
}

.hts-contact-intro p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--hts-text);
    margin: 0 0 24px;
}

.hts-office {
    background: #fff;
    border: 1px solid var(--hts-border-soft);
    border-radius: 12px;
    padding: 22px 22px 18px;
    margin-bottom: 18px;
}

.hts-office__title {
    font: 700 17px/1.3 Karla, sans-serif !important;
    letter-spacing: 0 !important;
    color: var(--hts-ink);
    margin: 0 0 12px !important;
}

.hts-office__list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.hts-office__list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 5px 0;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--hts-text);
}

.hts-office__list .hts-office__icon {
    flex: 0 0 20px;
    width: 20px;
    text-align: center;
    color: var(--hts-primary);
    font-size: 15px;
    line-height: 1.5;
}

.hts-office__list a {
    color: var(--hts-text);
    text-decoration: none;
}

.hts-office__list a:hover,
.hts-office__list a:focus {
    color: var(--hts-primary);
    text-decoration: underline;
}

.hts-hours {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 16px;
    margin: 0;
    padding-top: 12px;
    border-top: 1px dashed var(--hts-border-soft);
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--hts-muted);
}

.hts-hours dt {
    font-weight: 600;
    color: var(--hts-text);
}

.hts-hours dd {
    margin: 0;
}

/* ---------- Confirmation page --------------------------------------------- */

.hts-confirm-card {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.hts-confirm-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--hts-mint), var(--hts-primary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(18, 152, 193, .28);
}

.hts-confirm-icon svg {
    width: 38px;
    height: 38px;
}

.hts-confirm-card h1 {
    font: 700 34px/1.25 Karla, sans-serif !important;
    letter-spacing: -.01em !important;
    color: var(--hts-ink);
    margin: 0 0 12px !important;
}

.hts-lead {
    font-size: 17px;
    line-height: 1.6;
    color: var(--hts-text);
    max-width: 560px;
    margin: 0 auto 28px;
}

.hts-steps {
    list-style: none;
    counter-reset: hts-step;
    display: grid;
    gap: 12px;
    margin: 0 0 28px;
    padding: 0;
    text-align: left;
}

.hts-steps li {
    counter-increment: hts-step;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--hts-surface);
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--hts-text);
}

.hts-steps li::before {
    content: counter(hts-step);
    flex: 0 0 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--hts-primary);
    color: var(--hts-primary);
    font: 700 14px/24px Karla, sans-serif;
    text-align: center;
}

.hts-steps strong {
    display: block;
    color: var(--hts-ink);
}

.hts-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
}

@media (max-width: 575px) {
    .hts-confirm-card h1 { font-size: 26px !important; }
    .hts-lead { font-size: 16px; }
}

/* ---------- Runtime fixes (review follow-up) ------------------------------ */

/* Click tracking: GTM "All Elements" triggers read Click ID from the element
   actually clicked. Let clicks on the icon/label spans fall through to the
   button/link that carries the id and data-type/data-location. */
.hts-submit *,
.hts-btn-outline * {
    pointer-events: none;
}

/* The template script (main.min.js / script.js) inserts
   <span class="checkbox-custom-dummy"> after every checkbox. Hide it inside
   .form-check so it doesn't add an extra flex gap, and use the general
   sibling combinator so the checked-state label emphasis still matches. */
.hts-form .form-check .checkbox-custom-dummy {
    display: none;
}

.hts-form .form-check input[type=checkbox]:checked ~ .form-check-label {
    color: var(--hts-ink);
    font-weight: 600;
}

/* ---------- Sitewide fix ---------------------------------------------------- */

/* The template's page-title banner clones its heading into faded copies to the
   left and right. On phones those copies stretch the page to ~730px, so mobile
   browsers zoom the whole page out (everything looks tiny). Clip them to the banner. */
.page-title-wrap {
    overflow: hidden;
}
