/*
 * JWS ISP Core front-end styles.
 * Colors come from the theme's CSS variables; fallbacks match the NetFx palette
 * so the widgets render correctly on any theme.
 */

.jws-isp-plans,
.jws-isp-coverage,
.jws-isp-table-wrap {
    --jws-isp-primary: var(--primary-color, #112164);
    --jws-isp-button: var(--primary-button-background, #1f3bb1);
    --jws-isp-accent: var(--accent-color, #0d99e5);
    --jws-isp-secondary: var(--secondary-color, #4ddffd);
    --jws-isp-muted: #6b7280;
    --jws-isp-line: #e3e6f2;
    --jws-isp-surface: #fff;
}

/* ---------------------------------------------------------------------------
 * Grid
 * ------------------------------------------------------------------------ */

.jws-isp-grid {
    display: grid;
    gap: 30px;
    align-items: stretch;
}

.jws-isp-cols-1 { grid-template-columns: 1fr; }
.jws-isp-cols-2 { grid-template-columns: repeat(2, 1fr); }
.jws-isp-cols-3 { grid-template-columns: repeat(3, 1fr); }
.jws-isp-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .jws-isp-cols-3,
    .jws-isp-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
    .jws-isp-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
 * Plan card fallback (theme jws-price-table CSS wins when present)
 * ------------------------------------------------------------------------ */

.jws-isp-plans .jws-price-table {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--jws-isp-surface);
    border: 1px solid var(--jws-isp-line);
    border-radius: 10px;
    padding: 40px 35px;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.jws-isp-plans .jws-price-table:hover,
.jws-isp-plans .jws-price-table.actived {
    box-shadow: 0 20px 40px rgba(17, 33, 100, 0.08);
}

.jws-isp-plans .jws-price-table__top_heading {
    color: var(--jws-isp-accent);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.jws-isp-plans .jws-price-table__heading {
    color: var(--jws-isp-primary);
    margin: 8px 0 14px;
}

.jws-isp-plans .jws-price-table__price {
    display: flex;
    align-items: flex-start;
    color: var(--jws-isp-primary);
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.jws-isp-plans .jws-price-table__currency {
    font-size: 0.45em;
    margin-top: 0.35em;
}

.jws-isp-plans .jws-price-table__after-price {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.jws-isp-plans .jws-price-table__fractional-part {
    font-size: 0.45em;
    line-height: 1.2;
}

.jws-isp-plans .jws-price-table__period {
    color: var(--jws-isp-muted);
    font-size: 14px;
    font-weight: 400;
}

.jws-isp-promo-note,
.jws-isp-price-note {
    display: block;
    color: var(--jws-isp-muted);
    font-size: 13px;
    margin-top: 8px;
}

.jws-isp-plans .jws-price-table__subheading {
    display: block;
    color: var(--jws-isp-muted);
    margin-top: 10px;
}

.jws-isp-plans .jws-price-table__features-list {
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
    flex-grow: 1;
}

.jws-isp-plans .jws-price-table__features-list li {
    margin: 10px 0;
}

.jws-isp-plans .jws-price-table__feature-inner {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.jws-isp-plans .jws-price-table__feature-inner i {
    color: var(--jws-isp-secondary);
}

.jws-isp-plans .jws-price-table__footer {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.jws-isp-plans .jws-price-table__button,
.jws-isp-table-btn,
.jws-isp-coverage__submit {
    display: inline-block;
    background: var(--jws-isp-button);
    color: #fff;
    border: 0;
    border-radius: 5px;
    padding: 14px 28px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.jws-isp-plans .jws-price-table__button:hover,
.jws-isp-table-btn:hover,
.jws-isp-coverage__submit:hover {
    background: var(--jws-isp-accent);
    color: #fff;
}

.jws-isp-plans .jws-price-footer_detail {
    color: var(--jws-isp-muted);
    font-size: 14px;
    text-decoration: none;
}

.jws-isp-plans .jws-price-footer_detail:hover {
    color: var(--jws-isp-accent);
}

.jws-isp-plans .jws-isp-plan-card .jws-price-table__ribbon {
    position: absolute;
    top: 20px;
    right: 20px;
}

.jws-isp-plans .jws-price-table__ribbon-inner {
    background: var(--jws-isp-secondary);
    color: var(--jws-isp-primary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 5px 14px;
    text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
 * Billing toggle: price blocks switch by the wrapper's data-cycle
 * ------------------------------------------------------------------------ */

.jws-isp-billing-toggle {
    display: inline-flex;
    background: #f4f5f9;
    border-radius: 30px;
    padding: 5px;
    margin-bottom: 35px;
    gap: 4px;
}

.jws-isp-billing-toggle button {
    border: 0;
    background: transparent;
    color: var(--jws-isp-primary);
    border-radius: 25px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.jws-isp-billing-toggle button.active {
    background: var(--jws-isp-button);
    color: #fff;
}

.jws-isp-billing-toggle button:focus-visible {
    outline: 2px solid var(--jws-isp-accent);
    outline-offset: 2px;
}

.jws-isp-plans .jws-isp-price { display: none; }
.jws-isp-plans[data-cycle="monthly"] .jws-isp-price[data-cycle="monthly"],
.jws-isp-plans[data-cycle="6m"] .jws-isp-price[data-cycle="6m"],
.jws-isp-plans[data-cycle="12m"] .jws-isp-price[data-cycle="12m"] { display: flex; }

.jws-isp-plans:not([data-cycle="monthly"]) .jws-isp-cycle-monthly-only { display: none; }

/* ---------------------------------------------------------------------------
 * Tables (plan table + compare)
 * ------------------------------------------------------------------------ */

.jws-isp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.jws-isp-plan-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--jws-isp-surface);
}

.jws-isp-plan-table th,
.jws-isp-plan-table td {
    border-bottom: 1px solid var(--jws-isp-line);
    padding: 16px 18px;
    text-align: left;
    vertical-align: middle;
    color: inherit;
}

.jws-isp-plan-table thead th {
    color: var(--jws-isp-primary);
    font-weight: 700;
}

.jws-isp-plan-table tbody th a {
    color: var(--jws-isp-primary);
    font-weight: 700;
    text-decoration: none;
}

.jws-isp-plan-table tbody th a:hover {
    color: var(--jws-isp-accent);
}

.jws-isp-badge {
    display: inline-block;
    background: var(--jws-isp-secondary);
    color: var(--jws-isp-primary);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
    padding: 2px 10px;
    text-transform: uppercase;
}

.jws-isp-table-price strong {
    color: var(--jws-isp-primary);
    display: block;
}

.jws-isp-table-btn {
    padding: 10px 20px;
    font-size: 14px;
    white-space: nowrap;
}

.jws-isp-compare-name {
    display: block;
    color: var(--jws-isp-primary);
    font-weight: 700;
}

.jws-isp-compare-price {
    display: block;
    color: var(--jws-isp-accent);
    font-weight: 500;
}

@media (max-width: 767px) {
    .jws-isp-compare .jws-isp-sticky-col {
        position: sticky;
        left: 0;
        background: var(--jws-isp-surface);
        box-shadow: 2px 0 0 var(--jws-isp-line);
        z-index: 1;
    }
}

/* ---------------------------------------------------------------------------
 * Coverage checker: mirrors the NetFx availability form look
 * ------------------------------------------------------------------------ */

/* Keep the checker compact in full-width sections. */
.jws-isp-coverage {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.jws-isp-coverage__form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.jws-isp-field {
    flex: 1 1 220px;
    display: block;
}

.jws-isp-coverage__form input {
    width: 100%;
    height: 54px;
    background: var(--jws-isp-surface);
    border: 1px solid var(--jws-isp-line);
    border-radius: 5px;
    padding: 0 20px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.jws-isp-coverage__form input:focus {
    border-color: var(--jws-isp-secondary);
    outline: none;
}

.jws-isp-coverage__form input[aria-invalid="true"] {
    border-color: #dc3545;
}

.jws-isp-coverage__submit {
    height: 54px;
    padding: 0 28px;
    flex: 0 0 auto;
}

.jws-isp-coverage__submit[disabled] {
    opacity: 0.7;
    cursor: wait;
}

.jws-isp-coverage__error[hidden] {
    display: none;
}

.jws-isp-coverage__error {
    display: inline-block;
    background: var(--jws-isp-surface);
    border: 1px solid #f1c3c9;
    border-radius: 8px;
    color: #dc3545;
    font-size: 14px;
    margin: 10px 0 0;
    padding: 10px 16px;
}

.jws-isp-coverage__results { margin-top: 24px; }

.jws-isp-coverage__results .jws-isp-result-intro {
    /* White chip so the line stays readable on dark hero sections and light pages alike. */
    display: inline-block;
    background: var(--jws-isp-surface);
    border: 1px solid var(--jws-isp-line);
    border-radius: 8px;
    color: var(--jws-isp-primary);
    font-weight: 500;
    margin: 0 0 14px;
    padding: 12px 18px;
}

.jws-isp-result-plans {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.jws-isp-result-plan {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--jws-isp-surface);
    border: 1px solid var(--jws-isp-line);
    border-radius: 10px;
    padding: 16px 20px;
}

.jws-isp-result-plan__name {
    color: var(--jws-isp-primary);
    font-weight: 700;
}

.jws-isp-result-plan__speed {
    color: var(--jws-isp-muted);
    display: block;
    font-size: 13px;
}

.jws-isp-result-plan__price {
    color: var(--jws-isp-accent);
    font-weight: 700;
}

/* ---------------------------------------------------------------------------
 * Motion preferences
 * ------------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    .jws-isp-plans .jws-price-table,
    .jws-isp-billing-toggle button,
    .jws-isp-coverage__form input,
    .jws-isp-plans .jws-price-table__button,
    .jws-isp-table-btn,
    .jws-isp-coverage__submit {
        transition: none;
    }
}

/* Fallback for themes without the WP screen-reader-text utility. */
.jws-isp-plans .screen-reader-text,
.jws-isp-table-wrap .screen-reader-text,
.jws-isp-coverage .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

/* Featured ribbon: pin to the top-right corner instead of the theme's full-width band. */
.jws-isp-plans .jws-isp-plan-card .jws-price-table__ribbon {
    left: auto;
    right: 15px;
    top: 15px;
    width: auto;
    margin: 0;
    transform: none;
}
.jws-isp-plans .jws-isp-plan-card .jws-price-table__ribbon-inner {
    transform: none;
    margin: 0;
}

/* The featured card gets extra headroom so the Popular badge never touches the content at any column width. */
.jws-isp-plans .jws-isp-plan-card.actived {
    padding-top: 64px;
}
.jws-isp-plans .jws-isp-plan-card .jws-price-table__ribbon {
    pointer-events: none;
    z-index: 2;
}

/* ---------------------------------------------------------------------------
 * Install request form + tracker
 * ------------------------------------------------------------------------ */

.jws-isp-order,
.jws-isp-tracker {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.jws-isp-order__steps {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
}

.jws-isp-order__steps li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #73729a;
    font-size: 14px;
}

.jws-isp-order__dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f4f5f9;
    color: var(--primary-color, #112164);
    font-weight: 700;
}

.jws-isp-order__steps li.active .jws-isp-order__dot {
    background: var(--primary-button-background, #1f3bb1);
    color: #fff;
}

.jws-isp-order__steps li.done .jws-isp-order__dot {
    background: var(--secondary-color, #4ddffd);
    color: var(--primary-color, #112164);
}

.jws-isp-order__form,
.jws-isp-tracker__form {
    background: #fff;
    border: 1px solid #e3e6f2;
    border-radius: 10px;
    padding: 34px;
}

.jws-isp-order__step {
    display: none;
    border: 0;
    margin: 0;
    padding: 0;
}

.jws-isp-order__step.active {
    display: block;
}

.jws-isp-order__step legend {
    color: var(--primary-color, #112164);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 18px;
}

.jws-isp-order__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 20px;
}

.jws-isp-order__grid p {
    margin: 0 0 14px;
}

.jws-isp-order__wide {
    grid-column: 1 / -1;
}

.jws-isp-order__label {
    display: block;
    color: var(--primary-color, #112164);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.jws-isp-order input:not([type="checkbox"]),
.jws-isp-order select,
.jws-isp-tracker input {
    width: 100%;
    height: 50px;
    background: #fff;
    border: 1px solid #e3e6f2;
    border-radius: 5px;
    padding: 0 16px;
    font-size: 15px;
}

.jws-isp-order input:focus,
.jws-isp-order select:focus,
.jws-isp-tracker input:focus {
    border-color: var(--secondary-color, #4ddffd);
    outline: none;
}

.jws-isp-order input[aria-invalid="true"] {
    border-color: #dc3545;
}

.jws-isp-order__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.jws-isp-order__review {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 16px;
    margin: 0 0 18px;
}

.jws-isp-order__review dt {
    color: var(--primary-color, #112164);
    font-weight: 600;
}

.jws-isp-order__review dd {
    color: #73729a;
    margin: 0;
}

.jws-isp-order__ack {
    background: #f4f5f9;
    border-radius: 8px;
    color: #73729a;
    padding: 14px 16px;
}

.jws-isp-order__ack-link {
    color: var(--accent-color, #0d99e5);
    margin-left: 4px;
}

.jws-isp-order__error {
    display: inline-block;
    background: #fff;
    border: 1px solid #f1c3c9;
    border-radius: 8px;
    color: #dc3545;
    font-size: 14px;
    margin: 14px 0 0;
    padding: 10px 16px;
}

.jws-isp-order__error[hidden] {
    display: none;
}

.jws-isp-order__nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.jws-isp-order__nav .jws-isp-order__prev {
    background: #f4f5f9;
    color: var(--primary-color, #112164);
}

.jws-isp-order__nav button[hidden],
.jws-isp-order [hidden],
.jws-isp-tracker [hidden] {
    display: none !important;
}

.jws-isp-order__nav button {
    border: 0;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    padding: 14px 28px;
}

.jws-isp-order__nav .jws-isp-order__next,
.jws-isp-order__nav .jws-isp-order__submit {
    margin-left: auto;
    background: var(--primary-button-background, #1f3bb1);
    color: #fff;
}

.jws-isp-order__success {
    text-align: center;
    padding: 20px 0 40px;
}

.jws-isp-tracker__form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.jws-isp-tracker__form p {
    margin: 0;
}

.jws-isp-tracker__form button {
    height: 50px;
}

.jws-isp-tracker__result {
    margin-top: 24px;
}

.jws-isp-tracker__timeline {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    counter-reset: jws-isp-step;
}

.jws-isp-tracker__timeline li {
    flex: 1;
    position: relative;
    color: #b9b8cf;
    font-size: 14px;
    text-align: center;
    padding-top: 34px;
}

.jws-isp-tracker__timeline li::before {
    counter-increment: jws-isp-step;
    content: counter(jws-isp-step);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f4f5f9;
    color: #b9b8cf;
    font-weight: 700;
    line-height: 26px;
}

.jws-isp-tracker__timeline li.done {
    color: var(--primary-color, #112164);
}

.jws-isp-tracker__timeline li.done::before {
    background: var(--secondary-color, #4ddffd);
    color: var(--primary-color, #112164);
}

.jws-isp-tracker__timeline li.current {
    color: var(--primary-color, #112164);
    font-weight: 700;
}

.jws-isp-tracker__timeline li.current::before {
    background: var(--primary-button-background, #1f3bb1);
    color: #fff;
}

/* ---------------------------------------------------------------------------
 * Broadband Facts label (accessible table, FCC-style framing)
 * ------------------------------------------------------------------------ */

.jws-isp-bbf {
    max-width: 560px;
    margin: 50px auto;
    border: 3px solid var(--primary-color, #112164);
    border-radius: 6px;
    background: #fff;
    padding: 22px 26px;
}

.jws-isp-bbf__heading {
    border-bottom: 10px solid var(--primary-color, #112164);
    color: var(--primary-color, #112164);
    font-size: 34px;
    margin: 0 0 10px;
    padding-bottom: 8px;
}

.jws-isp-bbf__provider {
    color: #73729a;
    margin: 0 0 14px;
}

.jws-isp-bbf__table {
    width: 100%;
    border-collapse: collapse;
}

.jws-isp-bbf__table th,
.jws-isp-bbf__table td {
    border-bottom: 1px solid #e3e6f2;
    font-size: 14px;
    padding: 8px 0;
    text-align: left;
    vertical-align: top;
}

.jws-isp-bbf__table td {
    text-align: right;
    color: #73729a;
}

.jws-isp-bbf__section th {
    border-bottom: 2px solid var(--primary-color, #112164);
    color: var(--primary-color, #112164);
    font-size: 16px;
    padding-top: 16px;
}

.jws-isp-bbf__fees {
    list-style: none;
    margin: 0;
    padding: 0;
}

.jws-isp-bbf__footer {
    color: #73729a;
    font-size: 13px;
    margin: 14px 0 0;
}

.jws-isp-bbf-link {
    color: #73729a;
    font-size: 13px;
    text-decoration: underline;
}

.jws-isp-bbf-link:hover {
    color: var(--accent-color, #0d99e5);
}

@media (max-width: 640px) {
    .jws-isp-order__grid,
    .jws-isp-tracker__form {
        grid-template-columns: 1fr;
    }

    .jws-isp-order__steps .jws-isp-order__step-label {
        display: none;
    }

    .jws-isp-tracker__timeline {
        flex-wrap: wrap;
    }

    .jws-isp-tracker__timeline li {
        flex: 1 1 40%;
        margin-bottom: 12px;
    }
}


/* The theme sizes input[type=date] at 60px with a stronger selector; pin every order and tracker field to one height. */
.jws-isp-order .jws-isp-order__form input:not([type="checkbox"]),
.jws-isp-order .jws-isp-order__form select,
.jws-isp-tracker .jws-isp-tracker__form input {
    height: 50px !important;
    min-height: 50px;
    line-height: normal;
    margin: 0;
    box-sizing: border-box;
}

/* Same theme rule sets the postcode field to 60px; keep it level with the 54px submit button. */
.jws-isp-coverage .jws-isp-coverage__form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.jws-isp-coverage .jws-isp-coverage__form .jws-isp-coverage__submit {
    height: 54px;
    min-height: 54px;
    margin: 0;
    box-sizing: border-box;
}

/* Field and button stack on phones; stretch the button to the field width. */
@media (max-width: 480px) {
    .jws-isp-coverage .jws-isp-coverage__form .jws-isp-coverage__submit {
        flex: 1 1 100%;
    }
}

.jws-isp-tracker .jws-isp-result-intro {
    display: inline-block;
    background: #fff;
    border: 1px solid #e3e6f2;
    border-radius: 8px;
    color: var(--primary-color, #112164);
    font-weight: 500;
    margin: 0;
    padding: 12px 18px;
}
