/* Freedom Simulator – Elementor widget styles
 * Color tokens are exposed as CSS custom properties so the Elementor
 * style controls can override them per instance.
 */

.freedom-sim {
    --fs-accent: #F57D4A;
    --fs-accent-2: #E45C2E;
    --fs-panel-bg: #0B1B2B;
    --fs-panel-bg-2: #14283D;
    --fs-text: #1A2A3A;
    --fs-muted: #8A98A8;
    --fs-border: #E6E9EE;
    --fs-table-muted: rgba(255, 255, 255, 0.55);
    --fs-row-alt: rgba(255, 255, 255, 0.03);
    --fs-radius: 18px;

    /* Slider tokens — overridden by the Elementor "Sliders" controls. */
    --fs-slider-filled: var(--fs-accent);
    --fs-slider-unfilled: var(--fs-border);
    --fs-slider-thumb: #0B1B2B;
    --fs-slider-thumb-border: #FFFFFF;

    font-family: inherit;
    color: var(--fs-text);
    box-sizing: border-box;
}

.freedom-sim *,
.freedom-sim *::before,
.freedom-sim *::after {
    box-sizing: inherit;
}

.freedom-sim__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 48px;
    align-items: start;
}

@media (max-width: 960px) {
    .freedom-sim__inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* ---------- Form column ---------- */
.freedom-sim__eyebrow {
    display: inline-block;
    background: rgba(245, 125, 74, 0.12);
    color: var(--fs-accent);
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 24px;
}

.freedom-sim__heading {
    font-size: clamp(28px, 3.2vw, 40px);
    font-weight: 700;
    line-height: 1.15;
    color: var(--fs-text);
    margin: 0 0 32px;
}

.freedom-sim__field {
    margin-bottom: 24px;
}

.freedom-sim__label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--fs-text);
    margin-bottom: 10px;
}

.freedom-sim__slider-box {
    background: #fff;
    border: 1px solid var(--fs-border);
    border-radius: 12px;
    padding: 14px 18px 12px;
}

.freedom-sim__slider-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--fs-text);
    margin-bottom: 12px;
}

/* All slider rules use `input[type="range"].freedom-sim__slider`
   (specificity 0,2,1) so they outrank theme-level resets that target
   `input[type="range"]` directly (the parent theme's *global.min.css
   sets a grey background, 1 px border, padding, and box-shadow on every
   range input — that selector has specificity 0,1,1, so a class on its
   own would lose). The properties touched below explicitly null out the
   theme's additions (border, padding, box-shadow) on top of supplying
   the simulator's own look. */

input[type="range"].freedom-sim__slider {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    /* Used by Chrome / Safari / Edge-Chromium / iOS Safari — they paint
       the gradient directly on the input element. Firefox & IE ignore
       this and use their pseudo-element selectors below. */
    background: linear-gradient(
        to right,
        var(--fs-slider-filled) 0%,
        var(--fs-slider-filled) var(--progress, 50%),
        var(--fs-slider-unfilled) var(--progress, 50%),
        var(--fs-slider-unfilled) 100%
    );
    /* Reset properties the parent theme injects on every range input. */
    border: 0;
    padding: 0;
    box-shadow: none;
    max-width: 100%;
    border-radius: 999px;
    outline: none;
    margin: 0;
    /* Allow vertical scrolling while dragging the slider on touch
       devices, prevent the browser from hijacking the gesture. */
    touch-action: pan-y;
}

/* Keyboard focus ring (no effect for mouse / touch users thanks to
   :focus-visible). Prevents the slider being a black hole for tab nav. */
input[type="range"].freedom-sim__slider:focus-visible {
    outline: 2px solid var(--fs-accent, #F57D4A);
    outline-offset: 4px;
}

/* --- Chrome / Safari / Edge-Chromium / iOS Safari -------------------- */
input[type="range"].freedom-sim__slider::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent; /* gradient comes from the input itself */
    border-radius: 999px;
    border: none;
    box-shadow: none;
}

input[type="range"].freedom-sim__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--fs-slider-thumb);
    border: 3px solid var(--fs-slider-thumb-border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    /* Vertically centre the 22 px thumb on the 6 px track:
       -((22 - 6) / 2) = -8 px. */
    margin-top: -8px;
}

/* --- Firefox --------------------------------------------------------- */
input[type="range"].freedom-sim__slider::-moz-range-thumb {
    box-sizing: border-box;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--fs-slider-thumb);
    border: 3px solid var(--fs-slider-thumb-border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    cursor: pointer;
}

input[type="range"].freedom-sim__slider::-moz-range-track {
    height: 6px;
    background: var(--fs-slider-unfilled);
    border-radius: 999px;
    border: none;
    box-shadow: none;
}

/* Firefox: paint the filled portion (left of the thumb) in the accent
   colour. Without this, Firefox would show the whole track in grey
   because ::-moz-range-track overrides the gradient set on the input
   itself (Chrome/Safari render the gradient natively). */
input[type="range"].freedom-sim__slider::-moz-range-progress {
    height: 6px;
    background: var(--fs-slider-filled);
    border-radius: 999px;
}

/* Remove the dotted focus rectangle Firefox draws inside the input. */
input[type="range"].freedom-sim__slider::-moz-focus-outer {
    border: 0;
}

/* --- IE 11 / legacy (pre-Chromium) Edge ------------------------------ */
input[type="range"].freedom-sim__slider::-ms-track {
    width: 100%;
    height: 6px;
    background: transparent;
    border: none;
    color: transparent; /* hides the tick marks IE draws by default */
}

input[type="range"].freedom-sim__slider::-ms-fill-lower {
    background: var(--fs-slider-filled);
    border-radius: 999px;
}

input[type="range"].freedom-sim__slider::-ms-fill-upper {
    background: var(--fs-slider-unfilled);
    border-radius: 999px;
}

input[type="range"].freedom-sim__slider::-ms-thumb {
    box-sizing: border-box;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--fs-slider-thumb);
    border: 3px solid var(--fs-slider-thumb-border);
    cursor: pointer;
    /* IE doesn't apply margin-top to thumbs — track height handles it. */
    margin-top: 0;
}

input[type="range"].freedom-sim__slider::-ms-tooltip {
    display: none; /* IE adds a numeric tooltip on drag — hide it. */
}

.freedom-sim__slider-bounds {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--fs-muted);
    margin-top: 8px;
}

.freedom-sim__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 18px 28px;
    width: 100%;
    background: linear-gradient(135deg, var(--fs-accent) 0%, var(--fs-accent-2) 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    margin-top: 12px;
    text-align: center;
}

.freedom-sim__cta:hover,
.freedom-sim__cta:focus,
.freedom-sim__cta:active {
    background: linear-gradient(135deg, var(--fs-accent) 0%, var(--fs-accent-2) 100%);
    color: #fff;
    transform: none;
    box-shadow: none;
    text-decoration: none;
}

/* ---------- Results panel ---------- */
.freedom-sim__panel {
    background: var(--fs-panel-bg);
    border-radius: var(--fs-radius);
    padding: 28px;
    color: #fff;
    box-shadow: 0 30px 60px rgba(11, 27, 43, 0.18);
    overflow: hidden;
}

.freedom-sim__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: #fff;
    font-size: 14px;
}

.freedom-sim__table th,
.freedom-sim__table td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
}

.freedom-sim__table thead th {
    color: var(--fs-table-muted);
    font-weight: 500;
    font-size: 13px;
    line-height: 1.3;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 18px;
}

.freedom-sim__table thead th:first-child {
    color: var(--fs-table-muted);
}

.freedom-sim__table thead th:nth-child(2) {
    color: #fff;
    font-weight: 600;
}

.freedom-sim__table thead th.is-highlight {
    color: var(--fs-accent);
    font-weight: 700;
}

.freedom-sim__table tbody tr {
    transition: background 0.15s ease;
}

.freedom-sim__table tbody tr:nth-child(even) td {
    background: var(--fs-row-alt);
}

.freedom-sim__table tbody td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.freedom-sim__table tbody tr:last-child td {
    border-bottom: none;
}

/* Row label cell with leading icon */
.freedom-sim__row-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.freedom-sim__row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: var(--fs-table-muted);
    flex-shrink: 0;
}

.freedom-sim__row-icon svg {
    width: 18px;
    height: 18px;
}

.freedom-sim__row-icon--custom img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

/* Default value cells */
.freedom-sim__table tbody td:nth-child(2) {
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.freedom-sim__table tbody td:nth-child(3) {
    color: var(--fs-accent);
    font-weight: 600;
    white-space: nowrap;
}

/* Accent row: orange label & icon, both columns highlighted */
.freedom-sim__table tbody tr.is-accent .freedom-sim__row-label,
.freedom-sim__table tbody tr.is-accent .freedom-sim__row-icon {
    color: var(--fs-accent);
}

.freedom-sim__table tbody tr.is-accent td:nth-child(2),
.freedom-sim__table tbody tr.is-accent td:nth-child(3) {
    color: var(--fs-accent);
    font-weight: 700;
}

/* Muted row: gray label, gray values */
.freedom-sim__table tbody tr.is-muted .freedom-sim__row-label,
.freedom-sim__table tbody tr.is-muted .freedom-sim__row-icon,
.freedom-sim__table tbody tr.is-muted td:nth-child(2),
.freedom-sim__table tbody tr.is-muted td:nth-child(3) {
    color: var(--fs-table-muted);
    font-weight: 500;
}

/* Total row: full-width orange gradient bar with rounded corners */
.freedom-sim__table tbody tr.is-total td {
    background: linear-gradient(90deg, var(--fs-accent), var(--fs-accent-2)) !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 15px;
    border-bottom: none;
    padding-top: 18px;
    padding-bottom: 18px;
}

.freedom-sim__table tbody tr.is-total .freedom-sim__row-icon,
.freedom-sim__table tbody tr.is-total .freedom-sim__row-label {
    color: #fff !important;
}

.freedom-sim__table tbody tr.is-total td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.freedom-sim__table tbody tr.is-total td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* ---------- Bottom summary card ---------- */
.freedom-sim__summary {
    margin-top: 28px;
    padding: 22px 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

.freedom-sim__summary-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.freedom-sim__summary-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.freedom-sim__summary-amount {
    color: var(--fs-accent);
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}

.freedom-sim__summary-note {
    flex: 1 1 220px;
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    line-height: 1.5;
}

.freedom-sim__summary-note strong {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
}

.freedom-sim__data {
    display: none;
}
