/* ============================================================
   HouseFixWise Cost Calculator Styles
   Extends the HFW premium design system (navy/amber/white).
   ============================================================ */

/* ── Calculator root section ─────────────────────────────── */
.hfw-calc-root {
    padding: 64px 0;
}

/* ── Calculator card ─────────────────────────────────────── */
.hfw-calc-card {
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    max-width: 800px;
    margin: 0 auto;
}

/* Card header bar */
.hfw-calc-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 28px;
    background: #1d3557;
    color: #fff;
}
.hfw-calc-card__header-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}
.hfw-calc-card__header-icon svg {
    width: 22px;
    height: 22px;
    stroke: #d4922a;
}
.hfw-calc-card__header-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
}
.hfw-calc-card__header-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    margin-top: 3px;
}

/* Card body */
.hfw-calc-card__body {
    padding: 28px;
}

/* ── Form grid ────────────────────────────────────────────── */
.hfw-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}

.hfw-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hfw-form-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.01em;
}

.hfw-form-select {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    color: #1f2937;
    background: #f9fafb;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    transition: border-color 0.15s, background-color 0.15s;
    width: 100%;
    cursor: pointer;
}
.hfw-form-select:focus {
    outline: none;
    border-color: #1d3557;
    background-color: #fff;
}
.hfw-form-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ── Validation message ──────────────────────────────────── */
.hfw-calc-validation {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(220,38,38,0.08);
    border: 1px solid rgba(220,38,38,0.2);
    color: #dc2626;
    font-size: 13px;
    font-weight: 500;
}

/* ── Submit button (inherits hfw-btn styles; extra override) */
.hfw-btn--amber {
    background: #d4922a;
    color: #fff;
    border: none;
}
.hfw-btn--amber:hover {
    background: #c07d1e;
}

/* ── Disclaimer below card ───────────────────────────────── */
.hfw-calc-disclaimer {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 16px;
    line-height: 1.5;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ── "Calculator disabled" notice ────────────────────────── */
.hfw-calc-disabled,
.hfw-calc-notice {
    text-align: center;
    padding: 32px;
    color: #6b7280;
    font-size: 15px;
}

/* ═══════════════════════════════════════════════════════════
   RESULT CARD
   ═══════════════════════════════════════════════════════════ */
#hfw-calc-result {
    margin-top: 24px;
    border-top: 1px solid #e5e7eb;
    padding-top: 24px;
}

.hfw-calc-result__inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Estimated range card */
.hfw-calc-result__range-card {
    background: linear-gradient(135deg, #1d3557 0%, #2d5a8e 100%);
    border-radius: 12px;
    padding: 28px 32px;
    text-align: center;
    color: #fff;
}
.hfw-calc-result__badge {
    display: inline-block;
    background: rgba(212,146,42,0.2);
    border: 1px solid rgba(212,146,42,0.4);
    color: #e8a83e;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 9999px;
    padding: 4px 14px;
    margin-bottom: 12px;
}
.hfw-calc-result__price {
    font-size: 40px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.hfw-calc-result__unit {
    font-size: 14px;
    color: rgba(255,255,255,0.65);
    margin-top: 6px;
}
.hfw-calc-result__caveat {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin: 10px 0 0;
    line-height: 1.5;
}

/* Section title */
.hfw-calc-result__section-title {
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 10px;
}

/* Selected details grid */
.hfw-calc-result__details {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 20px;
}
.hfw-calc-result__detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}
.hfw-calc-result__detail-pill {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hfw-calc-result__detail-label {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.hfw-calc-result__detail-value {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}

/* Cost factors list */
.hfw-calc-result__factors {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 20px;
    background: #fff;
}
.hfw-calc-result__factor-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.hfw-calc-result__factor-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}
.hfw-calc-result__factor-list svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    stroke: #16a34a;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-top: 2px;
}

/* Safety note */
.hfw-calc-result__safety {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: rgba(234,88,12,0.06);
    border: 1px solid rgba(234,88,12,0.2);
    border-radius: 10px;
    padding: 14px 18px;
}
.hfw-calc-result__safety svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    stroke: #ea580c;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-top: 2px;
}
.hfw-calc-result__safety strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #ea580c;
    margin-bottom: 4px;
}
.hfw-calc-result__safety p {
    margin: 0;
    font-size: 13px;
    color: #78350f;
    line-height: 1.55;
}

/* Related guides */
.hfw-calc-result__related {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 20px;
    background: #fff;
}
.hfw-calc-result__related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.hfw-calc-result__related-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    text-decoration: none;
    color: #1f2937;
    transition: border-color 0.15s, background 0.15s;
}
.hfw-calc-result__related-card:hover {
    border-color: #1d3557;
    background: #fff;
}
.hfw-calc-result__related-title {
    font-size: 13px;
    font-weight: 600;
    color: #1d3557;
    line-height: 1.4;
}
.hfw-calc-result__related-excerpt {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.45;
}
.hfw-calc-result__related-cta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #d4922a;
    font-weight: 600;
    margin-top: 4px;
}
.hfw-calc-result__related-cta svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Source note */
.hfw-calc-result__source {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    margin: 0;
}

/* Result disclaimer */
.hfw-calc-result__disclaimer {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: rgba(212,146,42,0.06);
    border: 1px solid rgba(212,146,42,0.18);
    border-radius: 10px;
    padding: 12px 16px;
}
.hfw-calc-result__disclaimer svg {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    stroke: #d4922a;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-top: 2px;
}
.hfw-calc-result__disclaimer p {
    margin: 0;
    font-size: 12px;
    color: #78350f;
    line-height: 1.6;
}

/* Error state */
.hfw-calc-result__error {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: rgba(220,38,38,0.06);
    border: 1px solid rgba(220,38,38,0.2);
    border-radius: 10px;
    padding: 14px 18px;
    color: #dc2626;
    font-size: 14px;
}
.hfw-calc-result__error svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    stroke: #dc2626;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.hfw-calc-result__error p { margin: 0; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
    .hfw-form-grid {
        grid-template-columns: 1fr;
    }
    .hfw-calc-card__body {
        padding: 20px;
    }
    .hfw-calc-card__header {
        padding: 16px 20px;
    }
    .hfw-calc-result__price {
        font-size: 32px;
    }
    .hfw-calc-result__range-card {
        padding: 20px;
    }
    .hfw-calc-result__related-grid {
        grid-template-columns: 1fr;
    }
    .hfw-calc-result__detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}
