/* Geothermal REC Calculator page.
   Olive geothermal theme, matching the tokens used on the geothermal REC info
   pages (geothermal-hero.css) rather than the teal SREC palette.

   The step navigation itself comes from the shared css/form-stepper.css; this
   file only re-themes it through the --fstep-* tokens below. Square marks and
   a flatter treatment keep it visually distinct from the registration flow,
   which uses the same component with large round teal circles. */

.grec-calc {
    --grec-olive: #818d61;
    --grec-olive-dark: #66704d;
    --grec-olive-tint: #f3f4ee;
    --grec-border: #dcdfd2;
    --grec-muted: #6c757d;
    --grec-ink: #2c3e50;

    padding-bottom: 40px;
}

.grec-hidden {
    display: none !important;
}

.grec-calc .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Stepper theme ---------------------------------------------------- */

.grec-stepper {
    --fstep-accent: #818d61;
    --fstep-accent-deep: #66704d;
    --fstep-track: #dcdfd2;
    --fstep-ink: #2c3e50;
    --fstep-muted: #6c757d;

    --fstep-mark-size: 30px;
    --fstep-mark-radius: 4px;
    --fstep-mark-font: 0.8rem;
    --fstep-label-font: 0.68rem;
    --fstep-line-height: 2px;
    --fstep-gap: 26px;

    border: 1px solid var(--grec-border);
    border-radius: 4px;
    background: #fff;
    padding: 22px 24px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* --- Form fields ------------------------------------------------------ */

.grec-panel-fields {
    max-width: 620px;
}

.grec-form .form-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.7rem;
}

.grec-form label {
    flex: 0 0 45%;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.grec-form .form-control {
    flex: 1;
    padding: 0.3rem 0.55rem;
    font-size: 0.9rem;
}

.grec-form select.form-control {
    padding-right: 1.5rem;
}

.grec-help {
    flex-basis: 100%;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--grec-muted);
}

/* Consent row: box and text on one line, top-aligned so the box sits with the
   first line of text if it ever wraps. Deliberately not Bootstrap's
   .form-check, whose absolutely-positioned input fights the flex row. */
.grec-form .grec-consent {
    align-items: flex-start;
    gap: 9px;
    margin-top: 0.9rem;
}

.grec-form .grec-consent input[type="checkbox"] {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin: 2px 0 0;
}

.grec-form .grec-consent label {
    flex: 1 1 0;
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--grec-muted);
}

.grec-form-intro {
    margin-bottom: 0.25rem;
}

.grec-form-subintro {
    color: var(--grec-muted);
    margin-bottom: 1rem;
}

/* --- Callout ---------------------------------------------------------- */

/* For the one instruction on this form that changes the answer if it is
   misread: design load vs equipment capacity. */
.grec-callout {
    border: 1px solid var(--grec-olive);
    border-left-width: 4px;
    border-radius: 3px;
    background-color: var(--grec-olive-tint);
    color: var(--grec-ink);
    padding: 11px 14px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 720px;
}

.grec-callout strong {
    display: block;
    margin-bottom: 3px;
    color: var(--grec-olive-dark);
    font-size: 0.9rem;
}

/* --- Zone table ------------------------------------------------------- */

.grec-zone-scroll {
    overflow-x: auto;
}

/* table-layout: fixed so every row takes its columns from the header row.
   Without it the inputs size themselves and drift out of line with the
   headings above them. */
.grec-zone-table {
    --zone-cell-pad: 8px;
    --zone-input-pad: 0.45rem;

    width: 100%;
    min-width: 560px;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.grec-zone-table thead th {
    text-align: left;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--grec-muted);
    font-weight: 700;
    padding: 0 var(--zone-cell-pad) 6px 0;
    border-bottom: 1px solid var(--grec-border);
}

/* Nudge the numeric headings in by the input's own padding and border so the
   heading sits directly over the digits, not over the input's edge. */
.grec-zone-table thead th.grec-num {
    text-align: right;
    padding-right: calc(var(--zone-cell-pad) + var(--zone-input-pad) + 1px);
}

.grec-zone-num-col {
    width: 30px;
}

.grec-zone-load-col {
    width: 150px;
}

.grec-zone-remove-col {
    width: 34px;
}

.grec-zone-table td,
.grec-zone-table th.grec-zone-num {
    padding: 6px var(--zone-cell-pad) 6px 0;
    vertical-align: middle;
    border-bottom: 1px solid #eceee5;
}

.grec-zone-table .grec-zone:last-child .grec-zone-main td,
.grec-zone-table .grec-zone:last-child .grec-zone-main th {
    border-bottom: 1px solid var(--grec-border);
}

.grec-zone-num {
    text-align: left;
    font-weight: 700;
    color: var(--grec-olive-dark);
}

.grec-zone-table .form-control {
    padding: 0.2rem var(--zone-input-pad);
    font-size: 0.85rem;
    height: auto;
    width: 100%;
}

/* No max-width: the control fills its fixed column, so its right edge lands
   under the heading above it. */
.grec-zone-load {
    text-align: right;
}

.grec-zone-remove-cell {
    width: 30px;
    text-align: right;
}

.grec-zone-remove {
    background: none;
    border: 0;
    color: var(--grec-muted);
    font-size: 1.05rem;
    line-height: 1;
    padding: 2px 5px;
    cursor: pointer;
    border-radius: 3px;
}

.grec-zone-remove:hover,
.grec-zone-remove:focus {
    color: #96322f;
    background: #f6eeee;
}

.grec-zone-manual td {
    padding-top: 0;
    padding-bottom: 8px;
}

.grec-manual-pair {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: var(--grec-olive-tint);
    border: 1px solid var(--grec-border);
    border-radius: 3px;
    padding: 8px 10px;
}

.grec-manual-pair label {
    font-size: 0.8rem;
    margin: 0;
    color: var(--grec-muted);
}

.grec-manual-pair .form-control {
    max-width: 90px;
}

.grec-zone-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}

.grec-zone-add {
    background: #fff;
    border: 1px solid var(--grec-olive);
    color: var(--grec-olive-dark);
    border-radius: 3px;
    font-size: 0.82rem;
    padding: 4px 12px;
}

.grec-zone-add:hover,
.grec-zone-add:focus {
    background: var(--grec-olive-tint);
    color: var(--grec-olive-dark);
}

.grec-zone-total {
    margin: 0;
    font-size: 0.8rem;
    color: var(--grec-muted);
    font-variant-numeric: tabular-nums;
}

.grec-zone-total strong {
    color: var(--grec-ink);
}

/* --- Submit ----------------------------------------------------------- */

.grec-captcha {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

/* The widget is a fixed-width iframe; let it scroll rather than push the
   panel wider than the phone. */
@media (max-width: 400px) {
    .grec-captcha {
        justify-content: flex-start;
        overflow-x: auto;
    }
}

.grec-submit-row {
    text-align: center;
    padding: 16px 0 4px;
}

.grec-submit-btn {
    background-color: var(--grec-olive);
    border-color: var(--grec-olive);
    color: #fff;
}

.grec-submit-btn:hover,
.grec-submit-btn:focus {
    background-color: var(--grec-olive-dark);
    border-color: var(--grec-olive-dark);
    color: #fff;
}

.grec-disclaimer {
    font-size: 0.9rem;
    margin-top: 24px;
}

/* --- Results ---------------------------------------------------------- */

.grec-results {
    border: 1px solid var(--grec-border);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 24px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.grec-results-headline {
    border-left: 4px solid var(--grec-olive);
    padding-left: 14px;
    margin-bottom: 18px;
}

.grec-headline-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--grec-muted);
}

.grec-headline-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--grec-olive-dark);
    line-height: 1.2;
}

.grec-headline-sub {
    font-size: 1rem;
    color: var(--grec-ink);
}

.grec-headline-meta {
    font-size: 0.85rem;
    color: var(--grec-muted);
    margin-top: 4px;
}

.grec-email-notice {
    background-color: var(--grec-olive-tint);
    border: 1px solid var(--grec-border);
    color: var(--grec-ink);
    font-size: 0.9rem;
    padding: 0.6rem 0.9rem;
}

.grec-email-notice.grec-email-failed {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.grec-results-heading {
    margin-top: 18px;
    margin-bottom: 8px;
    font-size: 1rem;
    color: var(--grec-olive-dark);
}

.grec-table {
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.grec-table thead th {
    border-top: none;
    border-bottom: 2px solid var(--grec-ink);
    padding: 6px 8px;
}

.grec-table td {
    padding: 6px 8px;
    vertical-align: top;
}

.grec-num {
    text-align: right;
}

.grec-note {
    font-size: 0.78rem;
    color: var(--grec-muted);
}

.grec-note-list {
    font-size: 0.8rem;
    color: var(--grec-muted);
    padding-left: 18px;
}

.grec-note-list li {
    margin-bottom: 6px;
}

/* A KPI row across the full width. These four are the summary, so they read
   better side by side than stacked down one side of the report. */
.grec-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.grec-stat {
    background-color: var(--grec-olive-tint);
    border-radius: 4px;
    padding: 10px 12px;
}

.grec-stat-label {
    font-size: 0.8rem;
    color: var(--grec-muted);
    margin-bottom: 2px;
}

.grec-stat-value {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--grec-ink);
}

/* Two independent lists side by side, so each still reads top to bottom. */
.grec-detail-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 34px;
    align-items: start;
}

.grec-detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 14px;
    align-content: start;
    font-size: 0.83rem;
    margin-bottom: 0;
}

.grec-detail-list dt {
    color: var(--grec-muted);
    font-weight: 400;
}

.grec-detail-list dd {
    margin-bottom: 0;
    text-align: right;
    color: var(--grec-ink);
}

/* --- Call to action --------------------------------------------------- */

.grec-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 24px;
    padding: 18px 20px;
    border: 1px solid var(--grec-olive);
    border-left-width: 4px;
    border-radius: 4px;
    background-color: var(--grec-olive-tint);
}

.grec-cta-text {
    flex: 1 1 340px;
}

.grec-cta-text h5 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    color: var(--grec-olive-dark);
}

.grec-cta-text p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--grec-ink);
    max-width: 62ch;
}

.grec-cta-btn {
    flex: 0 0 auto;
    display: inline-block;
    background-color: var(--grec-olive-dark);
    color: #fff;
    padding: 10px 22px;
    border-radius: 3px;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.grec-cta-btn:hover,
.grec-cta-btn:focus {
    background-color: #545c3e;
    color: #fff;
    text-decoration: none;
}

/* --- Loading spinner -------------------------------------------------- */

.grec-spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.grec-spinner-box {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.grec-spinner {
    margin: 0 auto;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--grec-olive);
    border-radius: 50%;
    animation: grec-spin 1s linear infinite;
}

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

.grec-spinner-text {
    margin-top: 10px;
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--grec-olive);
}

/* --- Mobile ----------------------------------------------------------- */

@media (max-width: 768px) {
    .grec-stepper {
        padding: 18px 14px 14px;
    }

    .grec-form label {
        flex: 0 0 100%;
        margin-bottom: 2px;
    }

    .grec-form .form-control {
        flex: 0 0 100%;
    }

    .grec-zone-load {
        max-width: none;
    }

    .grec-headline-value {
        font-size: 1.6rem;
    }

    .grec-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grec-detail-cols {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .grec-detail-list {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .grec-detail-list dd {
        text-align: left;
        margin-bottom: 8px;
    }

    .grec-cta {
        flex-direction: column;
        align-items: flex-start;
    }

    .grec-cta-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .grec-stat-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .grec-spinner {
        animation: none;
    }
}
