/* ============================================================
   YOUR NRG — HERO REFACTOR
   New, self-contained classes. Namespaced `hero-` / `hform-`
   so nothing here collides with the existing global stylesheet.
   Brand tokens kept identical to the live site.
   ============================================================ */

:root {
    --hero-domestic:      #F3C9AF;
    --hero-domestic-tab:  #FBEEE4;
    --hero-domestic-hover:#F6E0CE;
    --hero-commercial:    #c7bfe3;
    --hero-commercial-tab:#EFEBF8;
    --hero-green:         #00a94e;
    --hero-green-dark:    #00913f;
    --hero-ink:           #1c1c1c;
    --hero-line:          #ededed;
    --hero-radius:        20px;
}

/* ---------- Top row: tabs (left) + reviews (right) ---------- */
.hero-top-row {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    position: relative;
    z-index: 2;
}

/* ---------- Folder tabs ---------- */
.hero-tabs {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 0 0 -1px 0 !important;
    padding: 0;
    flex: 0 0 auto;
    align-self: flex-end;
}
.hero-tabs .nav-item { margin: 0; }

.hero-tab {
    position: relative;
    border: 0;
    background: var(--hero-domestic-tab);
    color: var(--hero-ink);
    font-family: 'OnestBlack', sans-serif;
    font-size: 1rem;
    line-height: 1.2;
    padding: 16px 30px;
    border-radius: 14px 14px 0 0;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .25s ease, transform .25s ease;
}
.hero-tab:not(.active):hover { background: var(--hero-domestic-hover); }
.hero-tab.commercial:not(.active):hover { background: var(--hero-commercial-tab); }
.hero-tab.domestic.active   { background: var(--hero-domestic); }
.hero-tab.commercial.active { background: var(--hero-commercial); }
.hero-tab:focus-visible { outline: 3px solid #2965d8; outline-offset: 2px; }

/* ---------- The box ---------- */
.hero-card {
    position: relative;
    z-index: 1;
    border-radius: var(--hero-radius);
    border-top-left-radius: 0;          /* merges under the active tab */
    padding: clamp(24px, 4vw, 48px);
    overflow: hidden;
    transition: background-color .35s ease;
}
.hero-card.is-domestic   { background: var(--hero-domestic); }
.hero-card.is-commercial { background: var(--hero-commercial); }

/* ---------- Two-column grid: copy | media ---------- */
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(240px, 30%, 380px);
    align-items: end;
    gap: 24px;
}

.hero-eyebrow {
    font-family: 'OnestBlack', sans-serif;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .8rem;
    margin: 0 0 6px;
    color: var(--hero-ink);
}
.hero-title {
    font-family: 'OnestBlack', sans-serif;
    color: var(--hero-ink);
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    line-height: 1.04;
    margin: 0 0 6px;
}
.hero-sub {
    font-family: 'OnestMedium', sans-serif;
    color: var(--hero-ink);
    font-size: 1rem;
    margin: 0 0 18px;
}

/* ---------- Media column (character image) ---------- */
.hero-media {
    position: relative;
    align-self: end;
    min-height: 1px;
}
.hero-media picture { display: contents; }
.hero-media img {
    display: block;
    width: 100%;
    max-width: 310px;
    height: auto;
    margin: 0 0 0 auto;
    /* pull the cut-out so it sits on the floor of the card */
    margin-bottom: calc(-1 * clamp(24px, 4vw, 48px));
    pointer-events: none;
    -webkit-user-select: none;
            user-select: none;
}

/* ---------- Footnote under the card ---------- */
.hero-foot {
    margin: 12px 4px 0;
    text-align: center;
    font-size: .72rem;
    line-height: 1.4;
    color: #555;
}
.hero-foot a { color: inherit; text-decoration: underline; }

/* ============================================================
   MULTI-STEP FORM
   ============================================================ */
.hform {
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    max-width: 640px;
    box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

/* Progress header */
.hform-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 4px 12px;
}
.hform-step-label {
    font-family: 'OnestMedium', sans-serif;
    font-size: .8rem;
    color: #5a5a5a;
}
.hform-back {
    display: none;                 /* shown by JS on steps 2+ */
    align-items: center;
    gap: 6px;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-family: 'OnestMedium', sans-serif;
    font-size: .8rem;
    color: var(--hero-ink);
}
.hform-back.is-visible { display: inline-flex; }
.hform-back:hover { color: var(--hero-green-dark); }

.hform-progress {
    height: 6px;
    border-radius: 999px;
    background: rgba(0,0,0,.08);
    overflow: hidden;
    margin: 0 4px 14px;
}
.hform-progress-bar {
    height: 100%;
    width: 33.33%;
    border-radius: 999px;
    background: var(--hero-green);
    transition: width .35s cubic-bezier(.4,0,.2,1);
}

/* Steps */
.hform-steps { position: relative; }
.hform-step {
    display: none;
    animation: hformIn .3s ease both;
}
.hform-step.is-active { display: block; }
@keyframes hformIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* The field row — horizontal on desktop, stacked on mobile */
.hform-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: #fff;
}
.hform-field {
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.hform-field + .hform-field { border-left: 1px solid var(--hero-line); }
.hform-field label {
    font-family: 'OnestMedium', sans-serif;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #707070;
    margin: 0 0 2px;
}
.hform-field input,
.hform-field select {
    border: 0;
    outline: none;
    width: 100%;
    background: transparent;
    font-family: 'OnestMedium', sans-serif;
    font-size: 1rem;
    color: #000;
    padding: 2px 0;
}
.hform-field input::placeholder { color: #a6a6a6; }

/* Submit / next button lives inside the row on desktop */
.hform-action {
    flex: 0 0 auto;
    display: flex;
    align-items: stretch;
    padding-left: 10px;
}
.hform-btn {
    border: 0;
    border-radius: 12px;
    background: var(--hero-green);
    color: #fff;
    font-family: 'OnestMedium', sans-serif;
    font-size: 1rem;
    padding: 0 26px;
    min-height: 52px;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .2s ease, transform .05s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.hform-btn:hover { background: var(--hero-green-dark); }
.hform-btn:active { transform: translateY(1px); }
.hform-btn:disabled { opacity: .6; cursor: not-allowed; }
.hform-btn .hform-spinner { display: none; }
.hform-btn.is-loading .hform-spinner { display: inline-block; }
.hform-btn.is-loading .hform-btn-text { opacity: .7; }

.hform-spinner {
    width: 1em; height: 1em;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hformSpin .7s linear infinite;
}
@keyframes hformSpin { to { transform: rotate(360deg); } }

/* Inline error */
.hform-error {
    margin: 10px 4px 0;
    background: #fce8e8;
    border: 1px solid #f3b4b4;
    color: #b42323;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: .85rem;
    font-family: 'OnestMedium', sans-serif;
    display: none;
}
.hform-error.is-visible { display: block; }

.hform-tankerlink {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 12px 2px 0;
    font-family: 'OnestMedium', sans-serif;
    font-size: .9rem;
    color: var(--hero-ink);
    text-decoration: none;
    cursor: pointer;
}
.hform-tankerlink:hover { text-decoration: underline; }

/* ---------- Commercial "prefer to call" ---------- */
.hero-callprompt {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    font-family: 'OnestMedium', sans-serif;
    font-size: .9rem;
    color: var(--hero-ink);
}
.hero-callbtn {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--hero-ink);
    border-radius: 10px;
    padding: 8px 18px;
    text-decoration: none;
    color: var(--hero-ink);
    background: transparent;
    transition: background-color .2s ease, color .2s ease;
}
.hero-callbtn:hover { background: var(--hero-ink); color: #fff; }

/* ============================================================
   BARE FORM VARIANT  (.hform-bare — domestic)
   Transparent container, progress bar on the hero, each input its
   own white rounded box instead of one shared white card.
   ============================================================ */
.hform-bare {
    background: transparent;
    box-shadow: none;
    padding: 0;
}
.hform-bare .hform-head { margin: 0 2px 8px; }
.hform-bare .hform-progress { margin: 0 2px 16px; }

.hform-bare .hform-row {
    background: transparent;
    gap: 10px;
}
.hform-bare .hform-field {
    background: #fff;
    border-radius: 12px;
    padding: 10px 16px;
}
/* no dividers between separate white boxes */
.hform-bare .hform-field + .hform-field { border-left: 0; border-top: 0; }
.hform-bare .hform-action { padding-left: 0; }

@media (max-width: 767.98px) {
    .hform-bare .hform-row { gap: 10px; }
    .hform-bare .hform-action { padding-top: 0; }
}

/* ============================================================
   REVIEW STRIP (desktop, pinned right + fading)
   ============================================================ */
.hero-reviews {
    flex: 0 0 auto;
    width: 360px;
    height: 56px;
    margin-left: auto;
    position: relative;
}
.hero-review-panel {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    opacity: 0;
    animation: heroReviewFade 10.5s infinite;
}
.hero-review-panel:nth-child(1) { animation-delay: 0s;   }
.hero-review-panel:nth-child(2) { animation-delay: 3.5s; }
.hero-review-panel:nth-child(3) { animation-delay: 7s;   }
.hero-review-panel img { height: 40px; width: auto; }
.hero-review-meta {
    font-family: 'OnestMedium', sans-serif;
    font-size: .72rem;
    color: #444;
    line-height: 1.2;
    white-space: nowrap;
}
.hero-review-meta strong { font-family: 'OnestBlack', sans-serif; }

.hero-copy form {
    min-width: 100%;
}

@keyframes heroReviewFade {
    0%,4%   { opacity: 0; transform: translateY(4px); }
    9%,28%  { opacity: 1; transform: none; }
    33%,100%{ opacity: 0; }
}

/* Mobile review strip (stacks above tabs) */
.hero-reviews-mobile { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Desktop: lift the cut-out out of the grid and pin it to the card
   so it spans the FULL card height (height drives the size, not
   max-width). Transparent edges that overflow are clipped by the
   card's overflow:hidden. The copy column reserves room on the
   right so text never runs under the character. */
@media (min-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        padding-right: clamp(260px, 30%, 440px);
    }
    .hero-media {
        position: absolute;
        top: 0;
        right: clamp(8px, 1.5vw, 32px);
        bottom: 0;
        margin: 0;
        display: flex;
        align-items: flex-end;
        justify-content: flex-end;
        pointer-events: none;
    }
    .hero-media picture { display: block; height: 100%; }
}

@media (max-width: 991.98px) {
    .hero-grid { grid-template-columns: 1fr; gap: 10px; }
    .hero-media { align-self: center; }
    .hero-media img {
        margin: 10px auto 0;             /* centered under the form */
        margin-bottom: 0;                /* don't clip the cut-out on mobile */
        max-width: 240px;
    }
}

@media (max-width: 767.98px) {
    .hero-top-row { flex-direction: column; align-items: stretch; gap: 0; }

    .hero-reviews { display: none; }
    .hero-reviews-mobile {
        display: block;
        order: -1;
        position: relative;
        height: 48px;
        margin-bottom: 12px;
    }

    .hero-tabs { width: 100%; gap: 6px; }
    .hero-tab { flex: 1 1 0; text-align: center; padding: 14px 10px; white-space: normal; }

    .hero-card { border-top-left-radius: 0; border-top-right-radius: 0; }

    .hero-title { text-align: center; }
    .hero-eyebrow, .hero-sub { text-align: center; }

    /* form goes vertical */
    .hform { padding: 12px; }
    .hform-row { flex-direction: column; }
    .hform-field { padding: 12px 14px; }
    .hform-field + .hform-field { border-left: 0; border-top: 1px solid var(--hero-line); }
    .hform-action { padding: 12px 0 0; }
    .hform-btn { width: 100%; }
    .hform-tankerlink { justify-content: center; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-review-panel,
    .hform-step,
    .hform-progress-bar { animation: none !important; transition: none !important; }
}
