/* ===== MSP Profit Calculator ===== */

/* ===== Layout & Container Styles ===== */
.msp-calculator-container {
    background-image: url("/wp-content/themes/heimdal/img/redesign-v3/roi-calculator/hero-bg.jpg");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.msp-grid-row {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.msp-grid-row.results-row {
    align-items: flex-start;
    gap: 40px;
}

.environment-section {
    max-width: 280px;
    width: 100%;
}

.environment-section .toggle-label {
    margin-left: 10px;
}

.costs-section {
    width: 100%;
}

.msp-calculator {
    padding: 2rem;
    margin-top: 4rem;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 1px 36px 4px rgba(2, 80, 198, 0.10);
}

.section-divider {
    border: none;
    border-top: 1px solid #0065FE;
    margin: 14px 0 18px;
}

.main-divider {
    border: none;
    border-top: 1px solid #0065FE;
    margin: 25px 0;
}

.settings-grid {
    display: flex;
    gap: 20px;
}

/* Styles for disabled settings sections */
.settings-disabled {
    opacity: 0.65;
    position: relative;
}

.settings-disabled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    cursor: not-allowed;
    z-index: 5;
}

.settings-disabled input,
.settings-disabled select {
    background-color: #f5f5f5;
}

/* ===== Hero Section ===== */
.msp-hero {
    margin: 7rem 0 3rem;
}

.msp-hero .msp-logo {
    max-width: 240px;
}

/* ===== Section Titles ===== */
.section-title {
    color: #0A1A65;
    font-family: Inter;
    font-size: 22px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1.5px solid #0065FE;
}

.subsection-title {
    font-size: 0.95rem;
    margin: 0 0 0.6rem;
    color: #0A1A65;
    font-weight: 700;
}

/* ===== Toggle Switch ===== */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.toggle-label {
    font-weight: 600;
    color: #0A1A65;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    min-width: 48px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    width: 48px;
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #C7CBE1;
    transition: .2s;
    border-radius: 999px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background: white;
    transition: .2s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

.toggle-switch input:checked+.toggle-slider {
    background: #0065FE;
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(22px);
}

.toggle-switch input:focus+.toggle-slider {
    box-shadow: 0 0 0 3px rgba(0, 101, 254, .25);
}

/* ===== Form Input Styles ===== */
.inputs-grid {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
}

.inputs-grid.two-columns {
    grid-template-columns: repeat(2, 1fr);
}

.inputs-grid.three-columns {
    grid-template-columns: repeat(3, 1fr);
}

.input-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #0A1A65;
}

.input-field {
    position: relative;
}

.input-field input,
.input-field select {
    width: 100%;
    height: 42px;
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid #D9DBE9;
    background: #FFF;
    box-shadow: 0 1px 6px rgba(2, 80, 198, .05) inset;
}

/* CSS Variable for dynamic currency symbol */
:root {
    --currency-symbol: "$";
}

/* Style for input with currency */
.input-field.has-currency input {
    padding-left: 1.6rem;
    /* Make room for the currency symbol */
}

/* Currency symbol */
.input-field.has-currency::before {
    content: var(--currency-symbol);
    position: absolute;
    left: 0.7rem;
    top: 62%;
    transform: translateY(-25%);
    color: #6C76A3;
    z-index: 10;
    pointer-events: none;
    font-weight: 600;
}

.input-field input::placeholder {
    color: #A0A7C4;
}

.input-field input[type=number]::-webkit-outer-spin-button,
.input-field input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

/* ===== Comparison Table ===== */
.comparison-table {
    width: 100%;
}

.table-header,
.table-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 25px;
    align-items: center;
}

.table-header {
    padding: 14px 16px;
}

.table-row {
    padding: 12px 16px;
    border-bottom: 1px solid #F0F2FA;
}

.table-row:last-child {
    border-bottom: 0;
}

.row-total {
    font-weight: 700;
}

.row-margin {
    font-weight: 700;
}

.text-muted {
    color: #6C76A3;
    font-size: 12px;
    display: inline-block;
    margin-left: 4px;
}

.cost-highlight {
    color: #F92323;
    background: #FFE8EA;
    padding: 8px 17px;
    border-radius: 18px;
    font-weight: 800;
    margin-right: -17px;
    display: inline-block;
}

.savings-highlight {
    color: #0065FE;
    background: #E7F0FF;
    padding: 8px 17px;
    border-radius: 18px;
    font-weight: 800;
    margin-right: -17px;
    display: inline-block;
}

.margin-wrapper {
    position: relative;
    display: inline-block;
    text-align: center;
    min-width: 60px;
    margin-right: -14px;
}

.margin-value {
    font-weight: 800;
    color: #001858;
    /* navy */
    display: block;
}

.margin-positive {
    color: #13A10E;
    background: #EFFFF2;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 800;
    display: inline-block;
}

.margin-sub {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8em;
    font-weight: 400;
    white-space: nowrap;
    top: 100%;
    /* puts it below the main value */
    margin-top: 10px;
}

.margin-sub.gray {
    color: #6b7280;
}

.margin-sub.green {
    color: #13A10E;
}

/* Add styles for dynamic result highlighting */
.result-highlight {
    font-weight: bold;
    animation: pulse 2s ease-in-out;
}

@keyframes pulse {
    0% {
        background-color: transparent;
    }

    50% {
        background-color: rgba(19, 161, 14, 0.1);
    }

    100% {
        background-color: transparent;
    }
}

.margin-negative {
    color: #F92323;
    background: #FFE8EA;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 800;
}

.comparison-section {
    width: 100%;
}

.header-cell {
    color: #0A1A65;
    font-family: "Nunito Sans";
    font-size: 15px;
    font-style: normal;
    font-weight: 700;
    line-height: 34px;
    /* 200% */
    letter-spacing: -0.34px;
}

.header-cell.right {
    text-align: right;
}

.header-cell.blue,
.table-cell.blue {
    color: #0065FE;
}

.table-cell {
    color: #0A1A65;
    font-family: Inter;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.table-cell.bold {
    font-weight: 600;
}

.table-cell.bigger {
    font-size: 17px;
}

.table-cell.right {
    text-align: right;
}

/* ===== Summary Cards ===== */
.summary-section {
    width: 90%;
}

.summary-card {
    padding: 1.2rem 1.4rem;
    border-radius: 16px;
    border: 1px solid #D9DBE9;
    background: #FFF;
    box-shadow: 0 1px 30px rgba(2, 80, 198, .08);
    margin-bottom: 14px;
}

.summary-card.card-highlight {
    color: #fff;
    background: linear-gradient(270deg, #F92323 0%, #FF2F70 100%);
    border: none;
}

.card-title {
    color: #0A1A65;
    font-family: Inter;
    font-size: 22px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.card-title.white {
    color: #fff;
}

.card-amount {
    margin: 0 0 6px;
    font-weight: 800;
    font-size: 22px;
    color: #0065FE;
}

.card-amount.green {
    color: #13A10E;
}

.card-annual span {
    font-weight: 600;
    color: #13A10E;
}

.summary-card.card-highlight .card-amount {
    color: inherit;
}

.period {
    color: rgba(10, 26, 101, 0.60);
    font-weight: 500;
    opacity: .8;
    font-size: 12px;
}

.period.white {
    color: rgba(255, 255, 255, 0.70);
}

.card-description,
.card-annual {
    color: #2F3C7C;
    font-family: Inter;
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.card-description.white {
    color: #fff;
}

/* ===== CTA Buttons ===== */
.cta-container {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: block;
    border-radius: 8px;
    padding: 10px 18px;
    text-decoration: none;
    transition: .2s ease;
    white-space: nowrap;
    width: 48%;
    color: #0A1A65;
    text-align: center;
    font-family: "Nunito Sans";
    font-size: 19px;
    font-style: normal;
    font-weight: 600;
    letter-spacing: -0.42px;
}

.btn-outline {
    border: 2px solid #0A1A65;
    color: #0A1A65;
}

.btn-outline:hover {
    background: #0A1A65;
    color: #fff;
}

.btn-primary {
    background: linear-gradient(270deg, #F92323 0%, #FF2F70 100%);
    color: #fff;
    border: 2px solid #F92323;
}

.btn-primary:hover {
    background: linear-gradient(270deg, #d31818 0%, #F92323 100%);
    border: 2px solid #F92323;
}

/* ===== Footer ===== */
.msp-footer {
    margin-top: 20px;
}

.disclaimer {
    color: #E9ECFF;
    font-size: 14px;
    line-height: 1.5;
    max-width: 900px;
}

/* ===== Hero Section Text ===== */
.msp-hero h1 {
    color: #FFF;
    font-family: Inter, Arial, sans-serif;
    font-weight: 700;
    font-size: 48px;
    line-height: 1.2;
    margin: 14px 0 8px;
}

.msp-hero p {
    color: #E9ECFF;
    font-family: "Nunito Sans", Arial, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    max-width: 900px;
    font-weight: 600;
}

/* ===== Content Container Spacing ===== */
.content-container.section-space {
    padding-top: 5.5rem;
}

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

@media screen and (max-width:1599px) {

    .input-field label {
        min-height: 48px;
    }

    .input-field.has-currency::before {
        top: 71%;
    }
}

@media (max-width: 1200px) {
    .summary-section {
        max-width: 100%;
        width: 100%;
    }

    .header-cell,
    .table-cell {
        font-size: 15px;
    }

    .table-cell.bigger {
        font-size: 17px;
    }

    .inputs-grid.three-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1000px) {
    .msp-grid-row.results-row {
        gap: 25px;
    }
}

@media (max-width: 980px) {
    .msp-grid-row {
        flex-direction: column;
    }

    .environment-section {
        max-width: 100%;
    }

    .settings-grid {
        flex-direction: column;
    }

    .msp-hero {
        margin: 3rem 0 3rem;
    }
}

@media (max-width: 900px) {

    .inputs-grid.two-columns,
    .inputs-grid.three-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    /* Responsive table transformation */
    .comparison-section {
        width: 100%;
    }

    .comparison-table {
        width: 100%;
    }

    /* Adjust the layout of the table header and rows */
    .table-header {
        display: none;
        /* Hide the header on mobile */
    }

    .table-row {
        display: flex;
        flex-direction: column;
        padding: 15px 12px;
        position: relative;
        border-bottom: 2px solid #E7F0FF;
        gap: 10px;
        min-width: auto;
    }

    /* Create mobile data labels */
    .table-row .table-cell:nth-child(2):before {
        content: "Multi-Tool Setup: ";
        font-weight: 600;
        color: #0A1A65;
    }

    .table-row .table-cell:nth-child(3):before {
        content: "Heimdal Unified Platform: ";
        font-weight: 600;
        color: #0065FE;
    }

    /* Reset right alignment for mobile view */
    .table-cell.right {
        text-align: center;
    }

    /* Adjust spacing between cells */
    .table-cell {
        padding: 3px 0;
    }

    /* Make first cell (label) bold */
    .table-row .table-cell:first-child {
        font-weight: 600;
        font-size: 16px;
        border-bottom: 1px solid #F0F2FA;
        padding-bottom: 8px;
    }

    /* Highlight rows */
    .table-row.row-total,
    .table-row.row-margin {
        background-color: #F8FAFF;
        border-radius: 8px;
    }

    .summary-section {
        width: 100%;
    }

    /* Center text in cards on mobile */
    .summary-card {
        text-align: center;
    }

    .card-title,
    .card-amount,
    .card-description,
    .card-annual {
        text-align: center;
    }

    .card-annual span {
        display: inline-block;
    }

    /* Hero section responsive adjustments */
    .msp-hero h1 {
        font-size: 36px;
    }

    .msp-hero p {
        font-size: 17px;
    }

    /* Smaller padding for calculator */
    .msp-calculator {
        padding: 1.8rem;
    }
}

@media (max-width: 650px) {
    .msp-hero h1 {
        font-size: 32px;
    }

    .msp-hero p {
        font-size: 16px;
    }

    .msp-calculator {
        padding: 1.5rem;
    }
}

@media (max-width: 600px) {

    /* Single column inputs on mobile */
    .inputs-grid.two-columns,
    .inputs-grid.three-columns {
        grid-template-columns: 1fr;
    }

    /* Stack buttons on mobile */
    .cta-container {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
        font-size: 17px;
        text-align: center;
    }

    /* Adjust font sizes for better readability */
    .card-title {
        font-size: 20px;
    }

    .card-amount {
        font-size: 20px;
    }

    /* Improve spacing for card elements */
    .card-amount .period {
        display: inline-block;
        margin-left: 4px;
    }
}

@media (max-width: 520px) {

    .table-row {
        font-size: 14px;
    }

    .msp-calculator {
        padding: 1.5rem 1rem;
        border-radius: 15px;
    }

    .msp-hero h1 {
        font-size: 28px;
    }

    .msp-hero p {
        font-size: 16px;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 14px;
    }

    /* Further adjust mobile table */
    .table-row {
        padding: 12px 10px;
    }

    .table-row .table-cell:nth-child(2):before,
    .table-row .table-cell:nth-child(3):before {
        display: block;
        margin-bottom: 2px;
        font-size: 13px;
    }

    /* Adjust highlight badges */
    .cost-highlight,
    .savings-highlight {
        padding: 6px 14px;
        display: inline-block;
        margin-right: 0;
        margin-top: 3px;
    }
}

@media (max-width: 480px) {

    /* Improve toggle layout on very small screens */
    .toggle-container {
        flex-direction: row;
        align-items: flex-start;
    }

    .toggle-label {
        width: calc(100% - 60px);
        padding-top: 4px;
        font-size: 15px;
    }

    /* Fix margin values */
    .margin-wrapper {
        margin-right: 0;
    }

    .margin-sub {
        font-size: 10px;
        margin-top: 8px;
    }

    /* More compact highlights */
    .cost-highlight,
    .savings-highlight {
        padding: 5px 10px;
        margin-right: -10px;
        font-size: 14px;
    }

    .margin-positive {
        font-size: 15px;
        padding: 3px 10px;
    }

    /* Smaller cards */
    .summary-card {
        padding: 1rem 1.2rem;
    }

    .section-space {
        padding: 2rem 1rem;
    }
}

@media (max-width: 400px) {
    .toggle-container {
        gap: 6px;
    }

    /* Further optimize table for very small screens */
    .table-row {
        gap: 8px;
        padding: 10px 8px;
    }

    .table-row .table-cell:first-child {
        font-size: 15px;
    }

    .table-row .table-cell:nth-child(2):before,
    .table-row .table-cell:nth-child(3):before {
        font-size: 12px;
    }

    .section-title {
        font-size: 18px;
    }

    /* Adjust margin display for very small screens */
    .margin-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Smaller form elements */
    .input-field input,
    .input-field select {
        height: 38px;
        padding: 0.5rem 0.7rem;
        font-size: 0.9rem;
    }

    .input-field label {
        font-size: 15px;
    }
}

@media (max-width: 360px) {
    .msp-hero h1 {
        font-size: 24px;
    }

    .msp-hero p {
        font-size: 14px;
    }

    .section-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    /* Very compact design for tiny screens */
    .comparison-table {
        font-size: 12px;
    }

    .card-title {
        font-size: 16px;
    }

    .card-amount {
        font-size: 16px;
    }

    .btn {
        font-size: 16px;
        padding: 8px 14px;
    }

    .msp-calculator {
        margin-top: 2.5rem;
    }
}

/* Special handling for the margin row on mobile */
@media (max-width: 768px) {

    /* Specifically handle the total row */
    .row-total .table-cell:first-child {
        font-size: 17px;
        color: #0A1A65;
    }

    /* Add special styling for the margin row */
    .row-margin .table-cell:first-child {
        font-size: 17px;
    }

    .row-margin .table-cell:nth-child(2):before,
    .row-margin .table-cell:nth-child(3):before {
        display: block;
        margin-bottom: 8px;
    }

    .margin-wrapper {
        margin-right: 0;
        text-align: center;
        display: block;
    }

    .margin-positive {
        margin-top: 5px;
    }

    .row-margin .margin-sub {
        position: relative;
        left: 0;
        transform: none;
        display: block;
        margin-top: 5px;
    }

    /* Make highlight styles work better on mobile */
    .cost-highlight,
    .savings-highlight {
        margin-right: 0;
        display: inline-block;
        margin-top: 5px;
    }
}