/* FWP Renewals — front-end portal styles (scaffold) */

.fwp-renewals {
    max-width: 640px;
    margin: 2rem 0;
}

.fwp-renewals__title {
    margin-bottom: 1rem;
}

.fwp-renewals__lookup label {
    display: block;
    margin-bottom: .35rem;
    font-weight: 600;
}

.fwp-renewals__lookup input[type="email"] {
    width: 100%;
    max-width: 360px;
    padding: .55rem .6rem;
    margin-right: .5rem;
}

.fwp-renewals__lookup button {
    padding: .55rem 1rem;
    cursor: pointer;
}

.fwp-renewals__results {
    margin-top: 1.5rem;
}

.fwp-renewals__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fwp-renewals__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 0;
    border-bottom: 1px solid #e2e2e2;
}

.fwp-renewals__renew {
    white-space: nowrap;
    font-weight: 600;
}

.fwp-pr-quote {
    margin: 1rem 0;
    font-size: 1.15rem;
}
.fwp-pr-quote__label { font-weight: 600; }
.fwp-pr-quote__amount { font-weight: 700; }

/* Live summary — sticks to the top of the viewport on scroll (offset below any top-pinned bars) */
.fwp-pr-summary {
    position: sticky;
    top: var(--fwp-summary-top, 0);
    z-index: 100000;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    padding: .6rem .9rem;
    margin-bottom: 1rem;
    background: #003A5D;
    color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.fwp-pr-summary__items {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .5rem;
    align-items: center;
}
.fwp-pr-chip {
    display: inline-block;
    padding: .2rem .55rem;
    background: rgba(255, 255, 255, .12);
    border-radius: 999px;
    font-size: .85rem;
    white-space: nowrap;
}
.fwp-pr-chip b { font-weight: 600; opacity: .85; }
.fwp-pr-summary__total { font-size: 1.05rem; white-space: nowrap; }
.fwp-pr-summary__total-label { opacity: .8; margin-right: .25rem; }
.fwp-pr-summary__amount { font-weight: 800; font-size: 1.25rem; }

/* ---------- Enhanced source form (wizard accordion) ---------- */

.fwp-enhanced .gform_fields { display: block; }

/* Section header = accordion bar */
.fwp-enhanced .fwp-acc-header {
    position: sticky;
    top: 0; /* JS sets a cumulative top per header so they stack */
    z-index: 30;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: .6rem;
    cursor: pointer;
    user-select: none;
    margin: .75rem 0 0 !important;
    padding: 15px .9rem 15px .9rem !important;
    background: #f2f6f9;
    border: 1px solid #d8e2ea !important;
    border-radius: 8px;
    transition: background .15s ease, border-color .15s ease;
}
.fwp-enhanced .fwp-acc-header:hover { background: #e6eef4; }
/* Sections below the open one don't pin (so the next bar can't cover the open section's fields). */
.fwp-enhanced .fwp-acc-header.fwp-no-stick { position: relative; top: auto !important; }
/* Bare section with no visible fields yet (conditional) — hidden until a field appears. */
.fwp-enhanced .fwp-empty-group { display: none !important; }
.fwp-enhanced .fwp-acc-header.fwp-open {
    z-index: 31;
    background: #003A5D;
    border-color: #003A5D;
}
.fwp-enhanced .fwp-acc-header.fwp-open,
.fwp-enhanced .fwp-acc-header.fwp-open * { color: #fff !important; }

/* every direct child of the header sits on the same vertical center line */
.fwp-enhanced .fwp-acc-header > * { align-self: center !important; margin: 0 !important; }

/* keep GF's own title styling inline + vertically centered with the status circle */
.fwp-enhanced .fwp-acc-header .gsection_title,
.fwp-enhanced .fwp-acc-header > h2,
.fwp-enhanced .fwp-acc-header > h3 {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 1.05rem !important;
    line-height: 1.6rem !important;
    display: block !important;
}

/* status: open red circle while incomplete, green check when all required fields are filled */
.fwp-enhanced .fwp-acc-status {
    flex: 0 0 auto;
    width: 1.4rem; height: 1.4rem;
    border-radius: 50%;
    border: 2px solid #d63638;
    background: transparent;
    display: inline-block; text-align: center;
    font-size: .85rem; font-weight: 700; line-height: 1.25rem; color: #fff;
}
.fwp-enhanced .fwp-acc-header.fwp-complete .fwp-acc-status {
    border-color: #2e9e5b;
    background: #2e9e5b;
}

/* Plan section header doubles as the live summary bar (dark, always) */
.fwp-enhanced .fwp-plan-header {
    background: #003A5D !important;
    border-color: #003A5D !important;
}
.fwp-enhanced .fwp-plan-header,
.fwp-enhanced .fwp-plan-header * { color: #fff !important; }
.fwp-enhanced .fwp-plan-header .fwp-acc-snippet {
    margin-left: .6rem;
    max-width: none;
    white-space: normal;
    overflow: visible;
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}
.fwp-enhanced .fwp-plan-total {
    margin-left: auto;
    white-space: nowrap;
    padding-left: .75rem;
}
.fwp-enhanced .fwp-plan-total__label { opacity: .8; margin-right: .25rem; }
.fwp-enhanced .fwp-plan-total__amt { font-weight: 800; font-size: 1.2rem; }

/* collapsed summary snippet */
.fwp-enhanced .fwp-acc-snippet {
    margin-left: auto;
    padding-left: .75rem;
    font-size: .85rem;
    font-weight: 400;
    color: #5a6b7b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45%;
}

/* chevron on the LEFT (real injected SVG element — robust against theme ::before resets)
   points right when closed, down when open */
.fwp-enhanced .fwp-acc-chevron {
    flex: 0 0 auto;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 1.1rem; height: 1.1rem;
    color: #4B97CF;
    transition: transform .2s ease;
}
.fwp-enhanced .fwp-acc-chevron svg { display: block; }
.fwp-enhanced .fwp-acc-header.fwp-open > .fwp-acc-chevron { transform: rotate(90deg); color: #fff; }
.fwp-enhanced .fwp-subsection > .fwp-acc-chevron--sub { color: #4B97CF; }
.fwp-enhanced .fwp-subsection.fwp-open > .fwp-acc-chevron--sub { transform: rotate(90deg); }

/* panel fields (members) sit in a bordered body under the open header */
.fwp-enhanced .fwp-acc-hidden { display: none !important; }
.fwp-enhanced .gfield:not(.gsection) { padding: .35rem .85rem; }

/* Conditionally-hidden (e.g. Covered Individual beyond the selected count) — beats our own
   display:flex !important on the sub-section headers. */
.fwp-enhanced .gfield.fwp-cond-hidden,
.fwp-enhanced .fwp-cond-hidden { display: none !important; }

/* Nested sub-sections (e.g. Covered Individual #2-4) — collapsed shows the name on the right */
.fwp-enhanced .fwp-subsection {
    position: relative;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: .5rem;
    cursor: pointer;
    user-select: none;
    margin: .5rem .85rem .25rem 1.75rem !important;
    padding: .5rem .7rem .5rem .7rem !important;
    background: #eef3f7;
    border: 1px solid #dce6ee !important;
    border-left: 3px solid #4B97CF !important;
    border-radius: 6px;
}
.fwp-enhanced .fwp-subsection > * { align-self: center !important; margin: 0 !important; }
.fwp-enhanced .fwp-subsection .gsection_title,
.fwp-enhanced .fwp-subsection > h2,
.fwp-enhanced .fwp-subsection > h3 {
    margin: 0 !important; padding: 0 !important; border: 0 !important;
    font-size: .95rem !important; line-height: 1.2 !important; font-weight: 600;
}
.fwp-enhanced .fwp-sub-snippet {
    margin-left: auto;
    padding-left: .6rem;
    color: #003A5D;
    font-size: .88rem;
    font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%;
}
.fwp-enhanced .gfield.fwp-sub-member { margin-left: 1.75rem; }

/* Field flagged as incomplete when Next is blocked */
.fwp-enhanced .gfield.fwp-incomplete {
    outline: 2px solid #d63638;
    outline-offset: 2px;
    border-radius: 6px;
}

/* Next button per section */
.fwp-acc-next {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .85rem 1rem;
}
.fwp-next-btn {
    background: #4B97CF;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: .55rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}
.fwp-next-btn:hover { background: #003A5D; }
.fwp-next-msg { color: #b32d2e; font-size: .9rem; display: none; }
.fwp-acc-next.fwp-show-msg .fwp-next-msg { display: inline; }

/* Inputs polish */
.fwp-enhanced .ginput_container input[type=text],
.fwp-enhanced .ginput_container input[type=email],
.fwp-enhanced .ginput_container input[type=tel],
.fwp-enhanced .ginput_container select,
.fwp-enhanced .ginput_container textarea {
    border: 1px solid #cbd3db;
    border-radius: 6px;
    padding: .5rem .6rem;
}
.fwp-enhanced .ginput_container input:focus,
.fwp-enhanced .ginput_container select:focus,
.fwp-enhanced .ginput_container textarea:focus {
    outline: none;
    border-color: #4B97CF;
    box-shadow: 0 0 0 3px rgba(75, 151, 207, .18);
}

.fwp-renewals__label { display: flex; flex-direction: column; }
.fwp-renewals__hello { margin: .5rem 0 1rem; }
.fwp-renewals__notice {
    padding: .75rem 1rem;
    background: #eef7ee;
    border: 1px solid #cbe3cb;
    border-radius: 4px;
}
.fwp-renewals__error {
    padding: .75rem 1rem;
    background: #fdecec;
    border: 1px solid #f3c3c3;
    border-radius: 4px;
    margin-bottom: 1rem;
}
