/* Rates page (/Home/Residential-Electricity-Plans). Builds on style.css. */

:root {
    --line: #e3e8f0;
    --ink: #1e2f43;
    --soft: #f7f9fc;
    --selected: #eef6ff;
}

.plans-page {
    min-height: 100vh;
    background: var(--hero);
}

/* Several blocks here set display, which would otherwise beat the hidden attribute. */
.plans-page [hidden] {
    display: none !important;
}

.plans-hero {
    position: relative;
    padding: 100px 0 30px;
    overflow: hidden;
    background: var(--hero);
}

.plans-broker {
    margin-bottom: 18px;
    font-size: 18px;
    white-space: normal;
}

.plans-broker a {
    color: var(--navy);
}

.plans-broker a:hover,
.plans-broker a:focus-visible {
    color: var(--blue);
}

.plans-hero h1 {
    margin-bottom: 22px;
    font-size: 40px;
    line-height: 1.15;
}

.plans-zip {
    color: var(--orange);
}

.plans-search {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px 28px;
}

.plans-zip-form {
    width: 100%;
    max-width: 420px;
}

.plans-zip-form .rate-row {
    width: 100%;
}

.plans-zip-form .rate-row input {
    height: 56px;
    padding: 14px 16px;
}

.plans-zip-form .rate-row button {
    min-width: 128px;
}

.plans-tdsp {
    display: flex;
    min-height: 56px;
    margin: 0;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 16px;
}

.plans-tdsp strong {
    color: var(--navy);
}

.plans-tdsp select {
    height: 44px;
    padding: 0 12px;
    border: 1px solid #dfe3ea;
    border-radius: 6px;
    color: var(--navy);
    background: #fff;
    font: inherit;
    font-weight: 700;
}

.plans-body {
    padding-top: 26px;
    padding-bottom: 70px;
}

/* Filters */
.plans-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    margin-bottom: 18px;
}

.plans-control {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.plans-control-label {
    color: var(--navy);
    font-size: 14px;
    font-weight: 700;
}

/* "Include Testing Products": no label above, so it lines up with the buttons. */
.plans-control-check {
    align-self: flex-end;
}

.plans-check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.plans-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--navy);
    cursor: pointer;
}

.plans-check input:focus-visible {
    outline: 3px solid rgba(0, 138, 255, .35);
    outline-offset: 2px;
}

/* Marks a testing product, shown only with "Include Testing Products" on. */
.plan-testing {
    display: inline-block;
    margin-top: 4px;
    padding: 1px 8px;
    border-radius: 999px;
    color: #7a4b00;
    background: #fff1d0;
    font-size: 12px;
    font-weight: 800;
}

.segmented {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.segmented button {
    min-height: 40px;
    padding: 8px 15px;
    border: 1px solid #d7dde8;
    border-radius: 999px;
    color: var(--ink);
    background: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.segmented button:hover {
    border-color: var(--blue);
}

.segmented button[aria-pressed="true"] {
    border-color: var(--navy);
    color: #fff;
    background: var(--navy);
}

.segmented button:focus-visible,
.plan-enroll:focus-visible,
.featured-enroll:focus-visible,
.plan-more:focus-visible,
.featured-more:focus-visible,
.featured-card a:focus-visible,
.plans-link-button:focus-visible,
.plans-tdsp select:focus-visible,
.plans-table a:focus-visible {
    outline: 3px solid rgba(0, 138, 255, .35);
    outline-offset: 2px;
}

.plans-status {
    min-height: 24px;
    margin: 0;
    color: var(--ink);
    font-size: 15px;
}

.plans-status a {
    font-weight: 700;
}

/* Recommended and All Plans sections */
.plans-section {
    margin-top: 26px;
}

.plans-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px 16px;
    border-bottom: 3px solid var(--navy);
}

.plans-tab {
    margin: 0;
    padding: 10px 22px;
    border-radius: 10px 10px 0 0;
    color: #fff;
    background: var(--navy);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
}

.plans-section-note {
    margin: 0 4px 8px;
    color: var(--ink);
    font-size: 15px;
}

.plans-section-note strong {
    color: var(--navy);
    font-size: 17px;
}

.plans-table-wrap {
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 12px 12px;
    /* clip, not hidden: hidden would make this the scroll box and stop the header sticking. */
    overflow: clip;
    background: #fff;
}

.plans-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

/* Stays in view below the fixed site header; rate-plans.js sets the exact offset. */
.plans-table th {
    position: sticky;
    top: var(--plans-sticky-top, 74px);
    z-index: 2;
    padding: 12px 10px;
    /* A shadow, since collapsed borders don't travel with a sticky cell. */
    box-shadow: inset 0 -1px 0 var(--line);
    color: var(--muted);
    background: var(--soft);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.plans-table abbr {
    text-decoration: none;
    cursor: help;
}

.plans-table td {
    padding: 14px 10px;
    border-bottom: 1px solid #eef1f6;
    color: var(--ink);
    vertical-align: middle;
}

.plans-table tbody tr:last-child td {
    border-bottom: 0;
}

.plan-row:hover td {
    background: #fbfcfe;
}

.plans-table .col-enroll {
    width: 104px;
}

/* Enroll buttons: the site's orange call to action. */
.plan-enroll,
.featured-enroll {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--orange);
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s ease;
}

.plan-enroll {
    padding: 8px 18px;
    font-size: 14px;
}

.plan-enroll:hover,
.featured-enroll:hover,
.featured-card.is-enrollable:hover .featured-enroll {
    color: #fff;
    background: #cc5e00;
}

.col-provider {
    width: 132px;
}

.plan-logo {
    display: block;
    max-width: 112px;
    max-height: 38px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.plan-rep-name {
    color: var(--navy);
    font-weight: 800;
    line-height: 1.2;
}

.has-logo .plan-rep-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.col-plan {
    min-width: 180px;
}

.plan-name {
    display: block;
    color: var(--navy);
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.plan-meta {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
}

.plan-usage-note {
    display: block;
    margin-top: 2px;
    color: #b3311d;
    font-size: 13px;
}

.col-term {
    width: 92px;
    white-space: nowrap;
}

.plans-table .col-rate {
    width: 92px;
    text-align: right;
    white-space: nowrap;
}

td.col-rate {
    font-weight: 700;
}

.plans-table th.col-rate.is-selected {
    color: var(--navy);
    background: var(--selected);
}

.plans-table td.col-rate.is-selected,
.plan-row:hover td.col-rate.is-selected {
    color: var(--blue);
    background: var(--selected);
    font-size: 19px;
    font-weight: 800;
}

.plans-table .col-doc {
    width: 150px;
    text-align: center;
}

.plan-docs {
    display: inline-flex;
    gap: 12px;
    white-space: nowrap;
}

.plan-docs a,
.plan-docs .plan-none {
    font-weight: 700;
}

.plan-none {
    color: #b6bfcc;
}

.plans-table .col-more {
    width: 132px;
    text-align: right;
}

.plan-more {
    padding: 7px 14px;
    border: 1px solid var(--blue);
    border-radius: 999px;
    color: var(--blue);
    background: #fff;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.plan-more:hover,
.plan-more[aria-expanded="true"] {
    color: #fff;
    background: var(--blue);
}

/* Details */
.plans-table .plan-details-row td {
    padding: 0;
    background: var(--soft);
}

.plan-row.is-open td {
    border-bottom-color: transparent;
}

.plan-details {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 18px 28px;
    padding: 18px 20px 20px;
}

.plan-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    align-content: start;
    gap: 12px 22px;
    margin: 0;
}

.plan-facts dt,
.plan-comments h3 {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.plan-facts dd {
    margin: 2px 0 0;
    color: var(--ink);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.plan-comments p,
.plan-comments ul {
    margin: 4px 0 0;
    color: var(--ink);
}

.plan-comments ul {
    padding-left: 18px;
}

.plan-comments li + li {
    margin-top: 3px;
}

/* Featured Products */
.featured-section {
    margin: 0 0 30px;
}

.featured-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    padding-top: 20px;
}

/* Equal heights at rest, but an opened card shouldn't stretch its neighbors. */
.featured-cards:has(.featured-more[aria-expanded="true"]) {
    align-items: start;
}

.featured-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 22px rgba(21, 44, 91, .08);
}

/* A click anywhere on the card enrolls (rate-plans.js). */
.featured-card.is-enrollable {
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.featured-card.is-enrollable:hover {
    border-color: var(--blue);
    box-shadow: 0 10px 28px rgba(21, 44, 91, .16);
}

.featured-badge {
    display: flex;
    margin: 0;
    padding: 11px 16px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    background: var(--navy);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
}

.featured-icon svg {
    display: block;
    width: 17px;
    height: 17px;
}

.featured-top {
    padding: 18px 20px 20px;
    background: var(--selected);
    text-align: center;
}

.featured-provider {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
}

.featured-provider .plan-logo {
    max-width: 150px;
    max-height: 46px;
}

.featured-plan {
    margin: 10px 0 0;
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.featured-price {
    margin: 6px 0 0;
    color: var(--navy);
    font-size: 46px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.1;
}

.featured-unit {
    margin: 2px 0 0;
    color: var(--ink);
    font-size: 15px;
}

.featured-term {
    margin: 6px 0 0;
    color: var(--ink);
    font-size: 15px;
}

.featured-term strong {
    color: var(--navy);
}

.featured-divider {
    margin: 0 8px;
    color: #b6bfcc;
}

.featured-top .plan-usage-note {
    margin-top: 6px;
}

.featured-facts {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 18px 20px;
}

.featured-facts div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.featured-facts dt {
    color: var(--ink);
    font-size: 15px;
}

.featured-facts dd {
    margin: 0;
    color: var(--navy);
    font-weight: 800;
    text-align: right;
    overflow-wrap: anywhere;
}

/* margin-top: auto keeps the buttons and footers lined up when the cards differ in height. */
.featured-action {
    margin: auto 20px 0;
}

.featured-enroll {
    width: 100%;
    padding: 12px 18px;
    font-size: 17px;
}

.featured-foot {
    display: flex;
    flex-wrap: wrap;
    margin: 14px 20px 0;
    padding: 14px 0 16px;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    border-top: 1px dashed #cdd5e1;
}

/* The same 2px as .featured-more, so every footer, and the Enroll button
   above it, sits at the same height whether or not More details is there. */
.featured-foot .plan-docs {
    padding: 2px 0;
}

.featured-more {
    padding: 2px 0;
    border: 0;
    color: var(--blue);
    background: none;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.featured-card .plan-details {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px 20px 18px;
    border-top: 1px solid var(--line);
    background: var(--soft);
}

.featured-card .plan-facts {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

/* Loading, empty, notices */
.plans-loading {
    display: grid;
    gap: 10px;
    margin-top: 26px;
}

.plan-skeleton {
    height: 64px;
    border-radius: 10px;
    background: linear-gradient(90deg, #fff 0%, #f3f5fa 50%, #fff 100%);
    background-size: 200% 100%;
    animation: plans-shimmer 1.3s ease-in-out infinite;
}

@keyframes plans-shimmer {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

.plans-notice {
    margin: 18px 0;
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: #fff;
    font-size: 17px;
}

.plans-notice p {
    margin: 0 0 6px;
}

.plans-link-button {
    padding: 4px 0;
    border: 0;
    color: var(--blue);
    background: none;
    font-weight: 700;
    cursor: pointer;
}

.plans-disclosure {
    margin: 26px 0 0;
    font-size: 13px;
}

@media (max-width: 1199px) {
    .plans-table th,
    .plans-table td {
        padding-inline: 7px;
    }

    .plans-table .col-enroll { width: 92px; }
    .plan-enroll { padding-inline: 14px; }
    .col-provider { width: 112px; }
    .plan-logo { max-width: 96px; }
    .plans-table .col-more { width: 120px; }
}

/* Below desktop widths each plan becomes a card. */
@media (max-width: 991px) {
    /* Featured cards swipe sideways rather than stacking above the plan list. */
    .featured-cards {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: min(300px, 84%);
        gap: 14px;
        margin-inline: -15px;
        padding: 18px 15px 14px;
        overflow-x: auto;
        scroll-padding-inline: 15px;
        scroll-snap-type: x mandatory;
        overscroll-behavior-x: contain;
    }

    .featured-card {
        scroll-snap-align: start;
    }

    .featured-price {
        font-size: 40px;
    }

    .plans-table-wrap {
        border: 0;
        border-radius: 0;
        overflow: visible;
        background: none;
    }

    .plans-table,
    .plans-table tbody {
        display: block;
    }

    .plans-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .plans-table .plan-row {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-areas:
            "provider provider provider provider"
            "plan plan plan plan"
            "term r500 r1000 r2000"
            "docs docs docs docs"
            "enroll enroll more more";
        gap: 6px 10px;
        margin-top: 12px;
        padding: 14px 16px 16px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #fff;
    }

    .plans-table .plan-row.is-open {
        border-radius: 12px 12px 0 0;
    }

    .plans-table .plan-row td,
    .plan-row:hover td {
        display: block;
        width: auto;
        min-width: 0;
        padding: 2px 0;
        border: 0;
        background: none;
        text-align: left;
    }

    .plans-table .plan-row td[data-label]::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .col-provider { grid-area: provider; }
    .col-plan { grid-area: plan; }
    .plans-table .col-term { grid-area: term; white-space: normal; }
    .rate-500 { grid-area: r500; }
    .rate-1000 { grid-area: r1000; }
    .rate-2000 { grid-area: r2000; }
    .plans-table .col-doc { grid-area: docs; }
    .plans-table .col-enroll { grid-area: enroll; }
    .plans-table .col-more { grid-area: more; }

    .plans-table td.col-rate.is-selected,
    .plan-row:hover td.col-rate.is-selected {
        background: none;
        font-size: 18px;
    }

    .plan-enroll,
    .plan-more {
        width: 100%;
        padding: 10px 14px;
    }

    .plans-table .plan-details-row,
    .plans-table .plan-details-row td {
        display: block;
    }

    .plans-table .plan-details-row td {
        border: 1px solid var(--line);
        border-top: 0;
        border-radius: 0 0 12px 12px;
    }

    .plan-details {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .plan-facts {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 767px) {
    .plans-hero {
        padding-top: 104px;
    }

    .plans-hero h1 {
        font-size: 30px;
    }

    .plans-zip-form {
        max-width: none;
    }

    .plans-zip-form .rate-row button {
        min-width: 112px;
        padding-inline: 16px;
    }

    .plans-tab {
        padding: 9px 16px;
        font-size: 17px;
    }
}

@media (max-width: 430px) {
    /* style.css widens the landing page's zip row past the screen at this size. */
    .plans-zip-form .rate-row {
        width: 100%;
    }

    .plans-zip-form .rate-row input {
        flex-basis: auto;
    }

    .plans-table .plan-row {
        gap: 6px 8px;
        padding-inline: 14px;
    }
}
