/* ACWA Feasibility Engine – scoped styles */

.acwa-fe-root *,
.acwa-fe-root *::before,
.acwa-fe-root *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.acwa-fe-root {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1a1a1a;
    background: #ffffff;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 900px;
    margin: 2rem auto;
}

/* ── Tabs ── */
.acwa-fe-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e2e2;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.acwa-fe-tabs::-webkit-scrollbar { display: none; }

.acwa-fe-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 400;
    color: #666;
    cursor: pointer;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color .15s;
    font-family: inherit;
}
.acwa-fe-tab-btn:hover { color: #1a1a1a; }
.acwa-fe-tab-btn.acwa-active {
    color: #0067B8;
    border-bottom-color: #0067B8;
    font-weight: 500;
}

/* ── Panels ── */
.acwa-fe-panel { display: none; }
.acwa-fe-panel.acwa-active { display: block; }

/* ── Section label ── */
.acwa-fe-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #999;
    margin-bottom: .75rem;
    margin-top: 1.5rem;
}
.acwa-fe-section-label:first-child { margin-top: 0; }

/* ── Grid layouts ── */
.acwa-fe-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.acwa-fe-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.acwa-fe-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 640px) {
    .acwa-fe-grid-2,
    .acwa-fe-grid-3,
    .acwa-fe-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ── Card / metric card ── */
.acwa-fe-card {
    background: #ffffff;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    padding: 1rem 1.25rem;
}
.acwa-fe-metric-card {
    background: #f7f7f7;
    border-radius: 8px;
    padding: .9rem 1rem;
}
.acwa-fe-metric-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}
.acwa-fe-metric-val {
    font-size: 20px;
    font-weight: 500;
    color: #1a1a1a;
}
.acwa-fe-metric-sub {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}
.acwa-fe-metric-val.acwa-pos { color: #1D9E75; }
.acwa-fe-metric-val.acwa-neg { color: #D85A30; }
.acwa-fe-metric-val.acwa-warn { color: #BA7517; }

/* ── Form fields ── */
.acwa-fe-field { margin-bottom: 1rem; }
.acwa-fe-field label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
}
.acwa-fe-field select,
.acwa-fe-field input[type="number"] {
    width: 100%;
    padding: 7px 10px;
    font-size: 14px;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    background: #fff;
    color: #1a1a1a;
    font-family: inherit;
    appearance: auto;
}
.acwa-fe-field select:focus,
.acwa-fe-field input:focus {
    outline: 2px solid #0067B8;
    outline-offset: 1px;
    border-color: #0067B8;
}

/* ── Sliders ── */
.acwa-fe-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.acwa-fe-slider-row input[type="range"] {
    flex: 1;
    accent-color: #0067B8;
    height: 4px;
}
.acwa-fe-slider-val {
    font-size: 13px;
    font-weight: 500;
    min-width: 62px;
    text-align: right;
    color: #1a1a1a;
}

/* ── Divider ── */
.acwa-fe-divider {
    border: none;
    border-top: 1px solid #e8e8e8;
    margin: 1.25rem 0;
}

/* ── CAPEX bars ── */
.acwa-fe-capex-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
}
.acwa-fe-capex-label {
    width: 120px;
    color: #555;
    flex-shrink: 0;
    font-size: 12px;
}
.acwa-fe-capex-track {
    flex: 1;
    background: #f0f0f0;
    border-radius: 3px;
    height: 10px;
    position: relative;
}
.acwa-fe-capex-fill {
    height: 10px;
    border-radius: 3px;
    position: absolute;
    top: 0;
}
.acwa-fe-capex-num {
    width: 100px;
    text-align: right;
    font-weight: 500;
    font-size: 12px;
}

/* ── Chart wrapper ── */
.acwa-fe-chart-wrap {
    position: relative;
    width: 100%;
    height: 240px;
    margin-top: 1rem;
}

/* ── Scenario table ── */
.acwa-fe-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: .75rem;
}
.acwa-fe-table th {
    text-align: left;
    padding: 6px 10px;
    font-weight: 500;
    font-size: 11px;
    color: #777;
    border-bottom: 1px solid #e2e2e2;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.acwa-fe-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
}
.acwa-fe-table tr:last-child td { border-bottom: none; }
.acwa-fe-table tr.acwa-highlight td {
    font-weight: 500;
    background: #f5f9ff;
}
.acwa-fe-table td.acwa-neg { color: #D85A30; }

/* ── Badges ── */
.acwa-fe-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 500;
    line-height: 1.6;
}
.acwa-fe-badge-blue  { background: #E6F1FB; color: #0C447C; }
.acwa-fe-badge-green { background: #EAF3DE; color: #27500A; }
.acwa-fe-badge-amber { background: #FAEEDA; color: #633806; }
.acwa-fe-badge-red   { background: #FCEBEB; color: #791F1F; }

/* ── Sensitivity grid ── */
.acwa-fe-sensitivity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: .75rem;
}
@media (max-width: 480px) {
    .acwa-fe-sensitivity-grid { grid-template-columns: 1fr; }
}
.acwa-fe-sens-card {
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: .75rem 1rem;
}
.acwa-fe-sens-title {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin-bottom: .4rem;
}
.acwa-fe-sens-impact {
    font-size: 18px;
    font-weight: 500;
}
.acwa-fe-sens-desc {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* ── Verdict box ── */
.acwa-fe-verdict {
    border-radius: 10px;
    padding: 1rem 1.25rem;
    font-size: 14px;
    line-height: 1.6;
}

/* ── Note ── */
.acwa-fe-note {
    font-size: 12px;
    color: #999;
    margin-top: .5rem;
}

/* ── CTA button ── */
.acwa-fe-cta {
    display: inline-block;
    margin-top: 1rem;
    padding: 10px 20px;
    background: #0067B8;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}
.acwa-fe-cta:hover { background: #0055a0; color: #fff; }

/* ── Type info card ── */
.acwa-fe-type-info {
    margin-top: .75rem;
}
.acwa-fe-type-info-stats {
    display: flex;
    gap: 24px;
    font-size: 13px;
    flex-wrap: wrap;
}
.acwa-fe-type-info-stats div span {
    color: #888;
    display: block;
    font-size: 12px;
}

/* ── Legend ── */
.acwa-fe-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}
.acwa-fe-legend span {
    display: flex;
    align-items: center;
    gap: 5px;
}
.acwa-fe-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}
