/**
 * Calculator Form Styles
 * Redesign v1.2.0
 */

/* Main Wrapper */
.cpc-calculator-wrapper {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    background: transparent;
    /* Assuming page background is used or card style handled by theme */
    font-family: 'Inter', sans-serif;
    /* Fallback to theme font */
}

.cpc-calculator-wrapper h2 {
    font-size: 28px;
    color: #1a202c;
    margin-bottom: 25px;
    font-weight: 700;
}

.cpc-tabs-wrapper {
    margin-bottom: 25px;
    width: 100%;
}

.cpc-tabs-nav {
    display: flex;
    background: #0E5454;
    padding: 5px;
    border-radius: 12px;
    /* Less rounded to match form mostly, but user asked for previous style, sticking to "pill" logic but maybe less extreme if it needs to match form width */
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.cpc-tab-btn {
    flex: 1;
    /* Occupy full width */
    padding: 12px 24px;
    border: none !important;
    /* Ensure no border */
    background: transparent;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #fff !important;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center text */
    gap: 8px;
    outline: none !important;
    /* Remove focus ring */
    position: relative;
}

.cpc-tab-btn:hover {
    color: #2d3b09 !important;
    background: rgba(255, 252, 252, 0.925) !important;
}

.cpc-tab-btn.active {
    background: #8BB22B !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

/* Triangle Indicator */
.cpc-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -11px;
    /* Position right below the button */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-top: 11px solid #8BB22B;

    filter: drop-shadow(0 2px 2px rgba(64, 82, 19, 0.79));
}

/* Layout Content */
.cpc-main-content {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 40px;
    align-items: start;
    box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
    padding: 20px;
    border-radius: 10px;
}

.cpc-left-column {
    width: 100%;
}

.cpc-grid-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Form Groups */
.cpc-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.cpc-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    display: inline;
    align-items: center;
    gap: 8px;
}

.cpc-privacy-group>label {
    font-weight: 200;
}

.cpc-icon {
    padding-left: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.cpc-select,
.cpc-input {
    /*width: 100%;*/
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background-color: #ffffff;
    font-size: 15px;
    color: #334155;
    transition: all 0.2s ease;
    outline: none;
    appearance: none;
}

.cpc-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.cpc-input {
    /* No specific arrow styles needed */
}

.cpc-select:hover,
.cpc-input:hover {
    border-color: #cbd5e1;
}

.cpc-select:focus,
.cpc-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Right Column & Result Card */
.cpc-right-column {
    position: sticky;
    top: 20px;
    transition: margin-top 0.3s ease;
    /* Smooth transition for alignment */
}

/* Step 1 Alignment: Push down to align with buttons (approx H2 height + margin) */
.cpc-main-content.step-1-active .cpc-right-column {
    margin-top: 60px;
    /* Adjust based on H2 height (28px) + line-height + margin (25px) */
}

/* Step 2 Alignment: Align with top of content (H2) or form? User said "aligned to form", usually implies top. Default 0 is top. */
.cpc-main-content.step-2-active .cpc-right-column {
    margin-top: 60px;
    /* Align with form inputs, skipping the H2 title of step 2 as well? Assuming yes for consistency */
}

.cpc-result-wrapper {
    background: #0E5454;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.2);
    display: flex;
    /* Always display, JS can control visibility of amount if needed, or we keep it shown */
    flex-direction: column;
    align-items: center;
}

.cpc-result-label {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 10px;
}

.cpc-result-value {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 25px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.cpc-currency {
    font-size: 32px;
    font-weight: 600;
}

.cpc-period {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.8;
}

.cpc-cta-button {
    background: #ffffff !important;
    color: #000 !important;
    border: none !important;
    padding: 14px 32px !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    max-width: 200px;
}

.cpc-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Banner */
.cpc-banner {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    color: #be123c;
}

.cpc-banner strong {
    display: block;
    margin-bottom: 5px;
    color: #9f1239;
}

/* SUCCESS VIEW STATE */
.cpc-main-content.success-view {
    display: block;
    /* Disable grid for single column view */
    text-align: center;
}

.cpc-main-content.success-view .cpc-left-column {
    display: none;
}

.cpc-main-content.success-view .cpc-right-column {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: static;
    /* Reset sticky */
}


/* Responsive */
@media (max-width: 900px) {
    .cpc-main-content {
        grid-template-columns: 1fr;
    }

    /* Reset margins on mobile */
    .cpc-main-content.step-1-active .cpc-right-column,
    .cpc-main-content.step-2-active .cpc-right-column {
        margin-top: 0;
    }

    .cpc-right-column {
        order: -1;
        /* Result on top on mobile? Or bottom? Usually bottom for forms, but top for immediate feedback. Let's keep strict order or bottom. Default is bottom if just stacking. */
        position: static;
        order: 2;
        /* Put result after form on mobile */
    }
}

@media (max-width: 600px) {
    .cpc-grid-inputs {
        grid-template-columns: 1fr;
    }

    .cpc-tabs-nav {
        width: 100%;
        justify-content: center;
    }

    .cpc-tab-btn {
        flex: 1;
        justify-content: center;
    }
}