/* CPE Frontend Calculator */

.cpe-calc-wrapper {
    --cpe-accent: #2271b1;
    --cpe-accent-soft: rgba(34, 113, 177, 0.08);
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: transparent;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    color: #333;
}

.cpe-calc-wrapper *,
.cpe-calc-wrapper *:before,
.cpe-calc-wrapper *:after {
    box-sizing: inherit;
}

.cpe-calc-container {
    width: 100%;
    background: transparent;
    padding: 20px 0;
}

.cpe-calc-header {
    text-align: center;
    margin-bottom: 30px;
}

.cpe-calc-header h2 {
    margin: 0;
    font-size: 26px;
    color: #1d2327;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.cpe-section-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--cpe-accent);
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.cpe-input-group {
    margin-bottom: 25px;
}

.cpe-product-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.cpe-toggle-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    color: #888;
    transition: all 0.2s ease;
    text-align: center;
    user-select: none;
}

.cpe-toggle-btn:hover {
    border-color: #cbd5e1;
}

.cpe-toggle-btn.active {
    border-color: var(--cpe-accent);
    color: var(--cpe-accent);
    background: var(--cpe-accent-soft);
}

.cpe-input-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 12px;
    align-items: flex-end;
}

.cpe-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cpe-field-remove {
    flex: 0 0 auto;
}

.cpe-label {
    font-size: 11px;
    margin-bottom: 6px;
    font-weight: 600;
    color: #888;
    white-space: nowrap;
}

.cpe-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
    background-color: #fff;
    color: #333;
    font-family: inherit;
}

.cpe-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.4;
}

.cpe-input:focus {
    border-color: var(--cpe-accent);
    box-shadow: 0 0 0 3px var(--cpe-accent-soft);
}

.cpe-input::-webkit-outer-spin-button,
.cpe-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cpe-input[type=number] {
    -moz-appearance: textfield;
}

.cpe-btn {
    cursor: pointer;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    transition: all 0.2s ease;
    padding: 14px 24px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    font-family: inherit;
}

.cpe-btn-submit {
    background: var(--cpe-accent);
    color: #fff;
    width: 100%;
    margin-top: 10px;
}

.cpe-btn-submit:hover {
    filter: brightness(0.92);
}

.cpe-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cpe-dynamic-list {
    margin-bottom: 25px;
}

.cpe-dynamic-item {
    background: #fcfcfc;
    padding: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    margin-bottom: 12px;
    animation: cpeFadeIn 0.3s ease;
}

@keyframes cpeFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.cpe-remove-btn-inline {
    color: #ccc !important;
    cursor: pointer;
    font-size: 24px;
    border: none;
    background: transparent !important;
    padding: 0;
    line-height: 40px;
    height: 40px;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.cpe-remove-btn-inline:hover {
    color: #ff4d4d;
}

.cpe-results-card {
    margin-top: 30px;
    padding: 22px;
    background-color: #f9fafb;
    border-radius: 10px;
    border: 1px solid #eee;
}

.cpe-result-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: #555;
}

.cpe-result-row.cpe-total {
    font-weight: 800;
    font-size: 18px;
    color: #1d2327;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    align-items: center;
}

.cpe-result-value {
    color: #1d2327;
    font-weight: 700;
    text-align: right;
}

.cpe-accent {
    color: var(--cpe-accent) !important;
}

.cpe-old-price {
    text-decoration: line-through;
    color: #aaa;
    margin-right: 8px;
    font-weight: 400;
}

.cpe-unit {
    font-size: 11px;
    color: #aaa;
    margin-left: 4px;
    font-weight: 400;
}

.cpe-sup {
    font-size: 10px;
    color: #888;
    margin-left: 2px;
    font-weight: 400;
}

.cpe-disclaimer-container {
    margin-top: 15px;
    text-align: left;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.cpe-disclaimer-note {
    font-size: 11px;
    color: #888;
    font-style: italic;
    line-height: 1.4;
    margin-bottom: 4px;
    display: block;
}

/* Lead form */
.cpe-lead-form {
    margin-top: 30px;
    padding: 24px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
}

.cpe-lead-sub {
    color: #666;
    font-size: 14px;
    margin: 6px 0 0;
}

.cpe-lead-msg {
    margin-top: 14px;
    padding: 0;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
}

.cpe-lead-msg.cpe-success {
    color: #065f46;
    background: #ecfdf5;
    padding: 12px;
    border-radius: 6px;
}

.cpe-lead-msg.cpe-error {
    color: #991b1b;
    background: #fee2e2;
    padding: 12px;
    border-radius: 6px;
}

@media (max-width: 560px) {
    .cpe-product-toggle {
        flex-direction: column;
    }
    .cpe-input-row {
        flex-wrap: wrap;
    }
}
