/**
 * Thirst IV Telehealth checkout wizard styles.
 *
 * Ported from the IV-booking checkout (iv-therapy-booking-pro :: miv_get_custom_css)
 * so the telehealth wizard is visually identical, but namespaced under .tiv-th-*
 * so it is fully self-contained and never depends on the MIV plugin being active.
 */

/* Hide the theme's page title ("Telehealth Checkout") at the top of the wizard
   page — this stylesheet only loads on the checkout/wizard page, so it's scoped. */
.entry-title,
.page-title,
.elementor-page-title { display: none !important; }

.tiv-th-wrapper * {
    box-sizing: border-box;
}

.tiv-th-wrapper h1,
.tiv-th-wrapper h2,
.tiv-th-wrapper h3,
.tiv-th-wrapper h4,
.tiv-th-wrapper h5,
.tiv-th-wrapper h6 {
    font-weight: 600 !important;
    font-family: "Poppins", Sans-serif !important;
    text-transform: uppercase !important;
}

.tiv-th-wrapper .form-control,
.tiv-th-wrapper .form-select,
.tiv-th-wrapper .btn {
    border-radius: 8px !important;
}

.tiv-th-wrapper .alert {
    border-radius: 8px !important;
    margin-bottom: 1rem !important;
}

.tiv-th-wrapper {
    font-family: "Poppins", Sans-serif !important;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    min-height: 100vh;
    padding: 0px;
}

.tiv-th-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.tiv-th-header {
    background: linear-gradient(135deg, #3ED9C9 0%, #1e3a8a 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tiv-th-logo {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tiv-th-header-badge {
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tiv-th-progress-steps {
    display: flex;
    justify-content: space-between;
    padding: 25px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.tiv-th-step {
    text-align: center;
    flex: 1;
    position: relative;
}

.tiv-th-step:not(:last-child):after {
    content: '';
    position: absolute;
    top: 20px;
    left: 60%;
    right: -40%;
    height: 2px;
    background: #dee2e6;
    z-index: 1;
}

.tiv-th-step.active:not(:last-child):after {
    background: #3ED9C9 !important;
}

.tiv-th-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: 600;
    font-size: 1rem;
    color: #6c757d;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.tiv-th-step.active .tiv-th-step-circle {
    background: #3ED9C9;
    border-color: #3ED9C9;
    color: white;
}

/* Completed steps stay neutral — only the CURRENT step is highlighted cyan
   (matches the IV booking checkout). */
.tiv-th-step.done .tiv-th-step-circle {
    background: #fff;
    border-color: #dee2e6;
    color: #6c757d;
}
.tiv-th-step.done:not(:last-child):after {
    background: #dee2e6;
}

.tiv-th-step-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6c757d;
}

.tiv-th-step.active .tiv-th-step-label {
    color: #3ED9C9;
    font-weight: 600;
}

.tiv-th-step-content {
    padding: 10px;
    min-height: 500px;
}

.tiv-th-step-header {
    text-align: center;
    margin-bottom: 30px;
}

.tiv-th-step-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.tiv-th-step-subtitle {
    font-size: 1rem;
    color: #718096;
    max-width: 500px;
    margin: 0 auto;
}

.tiv-th-form-section {
    margin-bottom: 25px;
}

/* Uniform field spacing: the Bootstrap grid's vertical gutter was stacking on top
   of each field's own bottom margin (uneven gaps, worst when 2-col rows collapse
   to one column on mobile). Zero the gutter so every field is evenly spaced. */
.tiv-th-form-section .row { --bs-gutter-y: 0; }
.tiv-th-form-section .row > [class*="col-"],
.tiv-th-form-section > .mb-3 { margin-bottom: 18px; }

.tiv-th-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.tiv-th-label {
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 6px;
    display: block;
}

.tiv-th-input,
.tiv-th-select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 1rem;
    transition: all 0.2s ease;
    width: 100%;
}

.tiv-th-input:focus,
.tiv-th-select:focus {
    border-color: #3ED9C9;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
    outline: none;
}

.tiv-th-btn {
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tiv-th-btn-primary,
.tiv-th-btn-next,
.tiv-th-btn-complete {
    background: #3ED9C9 !important;
    border-color: #000000 !important;
    color: #ffffff !important;
}

.tiv-th-btn-primary:hover,
.tiv-th-btn-next:hover,
.tiv-th-btn-complete:hover {
    background: #3ED9C9 !important;
    border-color: #3ED9C9 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.tiv-th-btn-back,
.tiv-th-btn-outline {
    background: white !important;
    border: 1px solid #d1d5db !important;
    color: #4a5568 !important;
}

.tiv-th-btn-back:hover,
.tiv-th-btn-outline:hover {
    background: #f7fafc !important;
    border-color: #3ED9C9 !important;
    color: #3ED9C9 !important;
}

.tiv-th-btn-dark {
    background: #3ED9C9 !important;
    color: #ffffff !important;
    border: none !important;
}

.tiv-th-navigation-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
}

.tiv-th-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.tiv-th-divider:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.tiv-th-divider span {
    background: white;
    padding: 0 15px;
    color: #718096;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.tiv-th-link {
    color: #3ED9C9;
    text-decoration: none;
    font-weight: 500;
}

.tiv-th-link:hover {
    color: #254a8a;
    text-decoration: underline;
}

.tiv-th-summary-box {
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.tiv-th-summary-box-sticky {
    position: sticky;
    top: 20px;
}

.tiv-th-summary-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tiv-th-summary-image {
    text-align: center;
    margin-bottom: 14px;
}

.tiv-th-summary-image img {
    max-width: 160px;
    max-height: 200px;
    width: auto;
    height: auto;
    border-radius: 10px;
    background: #fff;
}

.tiv-th-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.tiv-th-summary-item:last-child {
    border-bottom: none;
}

.tiv-th-summary-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 12px 0;
}

.tiv-th-total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1rem;
}

.tiv-th-grand-total {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2d3748;
}

.tiv-th-grand-total-amount {
    font-size: 1.2rem;
    color: #3ED9C9;
}

.tiv-th-summary-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
}

.tiv-th-summary-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tiv-th-detail-item label {
    font-weight: 500;
    color: #4a5568;
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.tiv-th-detail-value {
    color: #2d3748;
    font-weight: 500;
}

.tiv-th-card-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 15px;
}

.tiv-th-terms-agreement {
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.tiv-th-terms-agreement:hover {
    background: #f0f4ff;
}

.tiv-th-terms-agreement.terms-error {
    border: 2px solid #c53030 !important;
    background: #fff5f5 !important;
    border-radius: 8px;
    padding: 12px;
    animation: tiv-th-terms-pulse 0.6s ease-in-out 2;
}

@keyframes tiv-th-terms-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(197, 48, 48, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(197, 48, 48, 0); }
}

.tiv-th-alert {
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.tiv-th-alert-danger {
    background: #fed7d7;
    border-color: #feb2b2;
    color: #c53030;
}

.tiv-th-loading {
    padding: 40px 15px;
}

.tiv-th-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-left: 3px solid #3ED9C9;
    border-radius: 50%;
    animation: tiv-th-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes tiv-th-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tiv-th-payment-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f0fff4;
    border-radius: 8px;
    border: 1px solid #c6f6d5;
}

.tiv-th-payment-icon {
    width: 40px;
    height: 40px;
    background: #38a169;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.tiv-th-footer {
    background: #F5F5DC !important;
    color: black !important;
    padding: 20px 30px;
    margin-top: 40px;
}

.tiv-th-footer-content {
    text-align: center;
}

.tiv-th-footer-features {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.tiv-th-feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.tiv-th-feature-item:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.tiv-th-list-check {
    list-style: none;
    padding: 0;
}

.tiv-th-list-check li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 8px;
    color: #4a5568;
    font-size: 0.95rem;
}

.tiv-th-list-check li:before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #3ED9C9;
    position: absolute;
    left: 0;
    top: 1px;
}

/* ------------------------- Stripe payment step ------------------------- */
.tiv-th-card-element {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
    transition: all 0.2s ease;
}

.tiv-th-card-element.StripeElement--focus {
    border-color: #3ED9C9;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.tiv-th-card-element.StripeElement--invalid {
    border-color: #c53030;
}

.tiv-th-card-errors {
    color: #c53030;
    font-size: 0.85rem;
    min-height: 1.2em;
    margin-top: 8px;
}

.tiv-th-payment-request {
    margin-bottom: 10px;
}

.tiv-th-secure-badges {
    display: flex;
    gap: 12px;
    font-size: 1.6rem;
    color: #8a94a6;
}

/* ------------------------- Thank-you / confirmation ------------------------- */
.tiv-th-thankyou {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 15px 10px;
}

.tiv-th-thankyou-check {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #38a169;
    color: #fff;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: tiv-th-pop 0.4s ease;
}

@keyframes tiv-th-pop {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}

.tiv-th-thankyou-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
}

.tiv-th-thankyou-sub {
    color: #718096;
    margin-bottom: 20px;
}

.tiv-th-thankyou-visit {
    background: #fbf7ee;
    border: 1px solid #d9c7a3;
    border-radius: 10px;
    padding: 20px;
    text-align: left;
}

.tiv-th-visit-btn {
    display: inline-flex;
    width: 100%;
    margin-top: 6px;
    font-size: 1.05rem;
    padding: 14px 24px;
}

.tiv-th-thankyou-foot {
    margin-top: 18px;
}

.tiv-th-redirect-note {
    margin-top: 10px;
    color: #718096;
    font-size: 0.9rem;
    text-align: center;
}

/* ------------------------- Responsive ------------------------- */
@media (max-width: 768px) {
    .tiv-th-progress-steps {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
        padding: 20px 15px !important;
    }

    .tiv-th-progress-steps::-webkit-scrollbar {
        display: none !important;
    }

    .tiv-th-step {
        flex: 0 0 auto !important;
        min-width: 80px !important;
        padding: 0 10px !important;
        position: relative !important;
    }

    .tiv-th-step:not(:last-child):after {
        content: '' !important;
        position: absolute !important;
        top: 18px !important;
        left: calc(50% + 25px) !important;
        right: -25px !important;
        height: 2px !important;
        background: #dee2e6 !important;
        z-index: 1 !important;
        display: block !important;
    }

    .tiv-th-step.active:not(:last-child):after {
        background: #3ED9C9 !important;
    }

    .tiv-th-step-circle {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.95rem !important;
    }

    .tiv-th-step-label {
        font-size: 0.75rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

@media (max-width: 576px) {
    .tiv-th-step {
        min-width: 70px !important;
        padding: 0 8px !important;
    }

    .tiv-th-step:not(:last-child):after {
        left: calc(50% + 20px) !important;
        right: -20px !important;
        top: 16px !important;
    }

    .tiv-th-step-circle {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.9rem !important;
        margin-bottom: 6px !important;
    }

    .tiv-th-step-label {
        font-size: 0.7rem !important;
    }

    .tiv-th-footer-features {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Product image ABOVE the order summary (matches IV-booking layout). */
.tiv-th-summary-media {
    text-align: center;
    margin-bottom: 15px;
}
.tiv-th-summary-media img {
    max-width: 200px;
    width: auto;
    height: auto;
    border-radius: 10px;
    background: #fff;
}

/* Apple Pay button (Apple SDK web component). Hidden until availability check. */
#tiv-th-applepay-wrap apple-pay-button {
    --apple-pay-button-width: 100%;
    --apple-pay-button-height: 48px;
    --apple-pay-button-border-radius: 8px;
    display: block;
    width: 100%;
}

/* 5939: The mini-ajax cart drawer ("majc") has its script+style dequeued on the
   wizard page (its click handlers hijack our nav buttons). That leaves its
   markup unstyled, so it renders as a plain "Your Treatments / No Product in the
   Cart!" block at the bottom of the checkout. Hide the leftover markup here. */
.majc-main-wrapper,
.majc-sidecart-overlay,
[id^="majc-main-wrapper"] { display: none !important; }


/* 2026-07-07 — Cowork UI polish (re-applied over 0.8.46): review grid, teal titles, HSA/FSA, consent spacing.
   NOTE FOR PLUGIN MAINTAINER: merge this block + the matching class-tiv-checkout-wizard.php markup changes
   into the plugin source, or the next zip deploy will wipe them again. */
.tiv-th-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 24px; }
@media (max-width: 767px) { .tiv-th-detail-grid { grid-template-columns: repeat(2, 1fr); } }
.tiv-th-detail-grid .tiv-th-detail-item { margin-bottom: 0; }
.tiv-th-summary-card-title { color: #3ED9C9; }
.tiv-th-hsa-badge { display: inline-flex; align-items: center; justify-content: center; align-self: center;
  font-weight: 700; font-size: 11px; letter-spacing: .4px; color: #fff; background: #3ED9C9;
  border-radius: 5px; padding: 5px 8px; line-height: 1; }
.tiv-th-hsa-note { margin-top: 10px; font-size: .85rem; color: #4a5568; }
.tiv-th-hsa-note .fas { color: #3ED9C9; margin-right: 6px; }
.tiv-th-terms-agreement label { line-height: 1.7; }
.tiv-th-terms-agreement { padding-top: 14px; padding-bottom: 14px; }
