/**
 * FluentForm Custom Validation - Billing Simulator
 *
 * Styles for the billing simulation button and result card.
 */

/* ========================================
   Simulate Button — inline layout
   ======================================== */

.fluentform .ff-el-input--content:has(.ffcv-billing-simulate-btn) {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-wrap: wrap;
}

.fluentform .ff-el-input--content:has(.ffcv-billing-simulate-btn) .ff-el-form-control {
    flex: 1;
    min-width: 0;
}

.fluentform .ff-el-input--content:has(.ffcv-billing-simulate-btn) .error {
    width: 100%;
}

/* ========================================
   Simulate Button — styling
   ======================================== */

.fluentform .ffcv-billing-simulate-btn {
    background-color: #35B08B;
    color: #FFFFFF;
    border: none;
    border-radius: 4px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.fluentform .ffcv-billing-simulate-btn:hover {
    background-color: #299474;
}

.fluentform .ffcv-billing-simulate-btn:active {
    background-color: #237f63;
}

.fluentform .ffcv-billing-simulate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================
   Result Card — container
   ======================================== */

.ffcv-billing-result {
    border: 2px solid #35B08B;
    border-radius: 1.5rem;
    background: rgba(53, 176, 139, 0.06);
    padding: 2rem 2rem 1.5rem;
    margin-top: 1.5rem;
    animation: ffcvBillingFadeIn 0.4s ease-out;
}

@keyframes ffcvBillingFadeIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Result Card — title
   ======================================== */

.ffcv-billing-result__title {
    font-size: 2rem;
    font-weight: 900;
    color: #35B08B;
    line-height: 1.15;
    margin: 0 0 1.25rem 0;
}

/* ========================================
   Result Card — body (amounts + house)
   ======================================== */

.ffcv-billing-result__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: center;
}

.ffcv-billing-result__amounts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ffcv-billing-result__annual,
.ffcv-billing-result__monthly {
    background: #35B08B;
    color: #FFFFFF;
    font-weight: 700;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    text-align: center;
    line-height: 1.3;
}

.ffcv-billing-result__annual {
    font-size: 1.25rem;
}

.ffcv-billing-result__monthly {
    font-size: 1.5rem;
}

/* ========================================
   Result Card — house diagram
   ======================================== */

.ffcv-billing-result__house {
    display: flex;
    justify-content: center;
}

.ffcv-billing-result__house svg {
    width: 100%;
    height: auto;
    max-width: 420px;
    display: block;
}

/* ========================================
   Result Card — footnote
   ======================================== */

.ffcv-billing-result__footnote {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.5;
    margin: 1rem 0 1.25rem;
}

/* ========================================
   Result Card — summary pill rows
   ======================================== */

.ffcv-billing-result__summary {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ffcv-billing-result__summary-row {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    border-radius: 0.5rem;
    overflow: hidden;
    color: #FFFFFF;
    font-weight: 600;
}

.ffcv-billing-result__summary-label {
    flex: 1;
    padding: 0.7rem 1.25rem;
    display: flex;
    align-items: center;
}

.ffcv-billing-result__summary-value {
    background: #FFFFFF;
    color: #333;
    padding: 0.7rem 1.25rem;
    min-width: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    margin: 4px;
    border-radius: 0.35rem;
}

.ffcv-billing-result__summary-row--achem {
    background: #2b7bb5;
}

.ffcv-billing-result__summary-row--taxes {
    background: #2a9d8f;
}

/* ========================================
   Error display in card
   ======================================== */

.ffcv-billing-error {
    border: 2px solid #dc3545;
    border-radius: 1.5rem;
    background: rgba(220, 53, 69, 0.06);
    padding: 1.5rem 2rem;
    margin-top: 1.5rem;
    text-align: center;
    color: #dc3545;
    font-weight: 500;
    font-size: 0.95rem;
    animation: ffcvBillingFadeIn 0.4s ease-out;
}

/* ========================================
   Autoconsumption percentage slider
   ======================================== */

.fluentform .ffcv-pct-slider-wrap {
    margin-top: 0.75rem;
}

.fluentform .ffcv-pct-slider-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.fluentform .ffcv-pct-slider-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fluentform .ffcv-pct-slider {
    flex: 1;
    min-width: 0;
    accent-color: #35B08B;
}

/* Bar turns red when the slider deviates > 10 pts from the recommended autoconsumption % */
.fluentform .ffcv-pct-slider--warn {
    accent-color: #dc3545;
}

.fluentform .ffcv-pct-slider-value {
    min-width: 3.5ch;
    text-align: right;
    font-weight: 600;
    color: #35B08B;
}

.fluentform .ffcv-slider-warning,
.fluentform .ffcv-consumption-warning {
    margin-top: 0.5rem;
    padding: 0.6rem 1rem;
    border: 2px solid #FFA500;
    border-radius: 0.75rem;
    background: rgba(255, 165, 0, 0.08);
    color: #b45309;
    font-weight: 500;
    font-size: 0.875rem;
    text-align: center;
    animation: ffcvBillingFadeIn 0.4s ease-out;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .ffcv-billing-result {
        padding: 1.5rem 1.25rem 1rem;
    }

    .ffcv-billing-result__body {
        grid-template-columns: 1fr;
    }

    .ffcv-billing-result__title {
        font-size: 1.6rem;
    }

    .ffcv-billing-result__monthly {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .fluentform .ff-el-input--content:has(.ffcv-billing-simulate-btn) {
        flex-direction: column;
    }

    .fluentform .ffcv-billing-simulate-btn {
        width: 100%;
    }

    .ffcv-billing-result {
        padding: 1.25rem 1rem 0.75rem;
    }

    .ffcv-billing-result__title {
        font-size: 1.4rem;
    }

    .ffcv-billing-result__summary-value {
        min-width: 35%;
    }
}
