/* ==========================================================================
   Loan Experts Calculator Suite — Main Stylesheet v2
   ========================================================================== */

/* ---- Reset / Base ---- */
.lecs-wrap *,
.lecs-wrap *::before,
.lecs-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }

.lecs-wrap {
    font-family: var(--lecs-font, 'Inter', sans-serif);
    color: #1e2336;
    line-height: 1.55;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Elementor / page-builder full-width fix */
.lecs-wrap,
.lecs-wrap .lecs-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* ---- Card ---- */
.lecs-card {
    background: var(--lecs-card-bg, #ffffff);
    border-radius: var(--lecs-radius, 10px);
    box-shadow: var(--lecs-shadow, 0 4px 24px rgba(1,6,48,.10));
    overflow: hidden;
    width: 100%;
}

/* ---- Card Header ---- */
.lecs-card__header {
    background: var(--lecs-primary, #010630);
    padding: 1.75rem 2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.lecs-card__header::after {
    content: '';
    position: absolute;
    right: -60px; top: -60px;
    width: 220px; height: 220px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    pointer-events: none;
}
.lecs-card__badge {
    display: inline-block;
    font-size: .68rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
    color: rgba(255,255,255,.65);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    padding: .2rem .75rem; margin-bottom: .75rem;
}
.lecs-card__title {
    font-size: 1.35rem; font-weight: 700; color: #fff;
    display: flex; align-items: center; gap: .6rem;
    margin-bottom: .4rem; line-height: 1.25;
}
.lecs-icon { width: 20px; height: 20px; flex-shrink: 0; opacity: .85; }
.lecs-card__desc { font-size: .875rem; color: rgba(255,255,255,.75); max-width: 600px; }

/* ---- TWO-COLUMN BODY ---- */
.lecs-card__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 400px;
}

.lecs-col-inputs {
    padding: 1.75rem 1.5rem 1.75rem 2rem;
    border-right: 1px solid #eaecf4;
    display: flex;
    flex-direction: column;
}

.lecs-col-results {
    padding: 1.75rem 2rem 1.75rem 1.5rem;
    background: #fafbff;
    display: flex;
    flex-direction: column;
}

/* Tablet */
@media (max-width: 860px) {
    .lecs-card__body { grid-template-columns: 1fr; }
    .lecs-col-inputs { border-right: none; border-bottom: 1px solid #eaecf4; padding: 1.5rem; }
    .lecs-col-results { padding: 1.5rem; }
}
@media (max-width: 480px) {
    .lecs-card__header { padding: 1.25rem; }
    .lecs-card__title { font-size: 1.1rem; }
}

/* ---- Fields Grid ---- */
.lecs-fields { display: flex; flex-direction: column; gap: 1rem; flex: 1; }
.lecs-field-group { display: flex; flex-direction: column; gap: .35rem; }

/* ---- Labels ---- */
.lecs-label {
    font-size: .8rem; font-weight: 600; color: #3d4461;
    display: flex; align-items: center; gap: .4rem;
}
.lecs-hint { font-size: .73rem; color: #8892ae; margin-top: .1rem; }

/* ---- Inputs ---- */
.lecs-input-wrap { position: relative; display: flex; align-items: center; }
.lecs-input {
    width: 100%;
    padding: .6rem .9rem;
    border: 1.5px solid #d4d9e8;
    border-radius: calc(var(--lecs-radius, 10px) - 2px);
    font-size: .92rem; color: #1e2336;
    background: #fff;
    transition: border-color .18s, box-shadow .18s;
    -moz-appearance: textfield; outline: none;
}
.lecs-input::-webkit-outer-spin-button,
.lecs-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.lecs-input:focus {
    border-color: var(--lecs-primary, #010630);
    box-shadow: 0 0 0 3px rgba(1,6,48,.08);
    background: #fff;
}
.lecs-input-wrap.lecs-input--prefix .lecs-input { padding-left: 1.9rem; }
.lecs-input-wrap.lecs-input--suffix .lecs-input { padding-right: 2.1rem; }
.lecs-prefix, .lecs-suffix {
    position: absolute; font-size: .88rem; font-weight: 600;
    color: #6e7a99; pointer-events: none; user-select: none;
}
.lecs-prefix { left: .7rem; }
.lecs-suffix { right: .7rem; }

.lecs-select {
    width: 100%;
    padding: .6rem 2.1rem .6rem .9rem;
    border: 1.5px solid #d4d9e8;
    border-radius: calc(var(--lecs-radius, 10px) - 2px);
    font-size: .92rem; color: #1e2336;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24' stroke='%236e7a99' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right .7rem center;
    background-size: .9rem;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    outline: none; cursor: pointer;
    transition: border-color .18s;
}
.lecs-select:focus { border-color: var(--lecs-primary, #010630); box-shadow: 0 0 0 3px rgba(1,6,48,.08); }

/* ---- Radio ---- */
.lecs-radio-group { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .2rem; }
.lecs-radio {
    display: flex; align-items: center; gap: .4rem;
    font-size: .84rem; cursor: pointer;
    padding: .4rem .8rem;
    border: 1.5px solid #d4d9e8; border-radius: 999px;
    transition: border-color .15s, background .15s; user-select: none;
}
.lecs-radio input[type="radio"] { display: none; }
.lecs-radio__box {
    width: 13px; height: 13px; border-radius: 50%;
    border: 2px solid #c4cad9; flex-shrink: 0;
    transition: border-color .15s;
}
.lecs-radio input[type="radio"]:checked ~ .lecs-radio__box {
    border-color: var(--lecs-primary, #010630);
    background: var(--lecs-primary, #010630);
    box-shadow: inset 0 0 0 2px #fff;
}
.lecs-radio:has(input:checked) {
    border-color: var(--lecs-primary, #010630);
    background: rgba(1,6,48,.04); font-weight: 600;
}

/* ---- Checkbox ---- */
.lecs-checkbox {
    display: flex; align-items: center; gap: .5rem;
    font-size: .84rem; cursor: pointer; user-select: none;
}
.lecs-checkbox input[type="checkbox"] { display: none; }
.lecs-checkbox__box {
    width: 17px; height: 17px; border: 2px solid #c4cad9;
    border-radius: 4px; flex-shrink: 0;
    position: relative; transition: all .15s; background: #fff;
}
.lecs-checkbox input[type="checkbox"]:checked ~ .lecs-checkbox__box {
    background: var(--lecs-primary, #010630);
    border-color: var(--lecs-primary, #010630);
}
.lecs-checkbox input[type="checkbox"]:checked ~ .lecs-checkbox__box::after {
    content: '';
    position: absolute; left: 3px; top: 0px;
    width: 6px; height: 10px;
    border: 2px solid #fff; border-top: none; border-left: none;
    transform: rotate(45deg);
}

/* ---- Tooltip ---- */
.lecs-tooltip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 15px; height: 15px; border-radius: 50%;
    background: #c4cad9; color: #fff;
    font-size: .62rem; font-weight: 700; cursor: help;
    position: relative; flex-shrink: 0;
}
.lecs-tooltip::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%);
    background: #1e2336; color: #fff;
    font-size: .73rem; font-weight: 400;
    padding: .45rem .7rem; border-radius: 6px;
    white-space: normal; width: 200px; line-height: 1.4;
    z-index: 999; opacity: 0; pointer-events: none;
    transition: opacity .18s;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.lecs-tooltip:hover::after { opacity: 1; }

/* ---- Actions (bottom of input col) ---- */
.lecs-actions {
    display: flex; gap: .65rem; flex-wrap: wrap;
    margin-top: auto; padding-top: 1.25rem;
}

.lecs-btn {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .62rem 1.35rem;
    border-radius: var(--lecs-radius, 10px);
    font-size: .87rem; font-weight: 600; cursor: pointer;
    border: none; transition: all .18s;
    text-decoration: none; line-height: 1;
}
.lecs-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.lecs-btn--ghost {
    background: transparent; color: #6e7a99;
    border: 1.5px solid #d4d9e8;
}
.lecs-btn--ghost:hover { border-color: #a0aac0; color: #3d4461; background: #f5f6fa; }

.lecs-btn--pdf {
    background: var(--lecs-btn, #010630);
    color: #fff;
}
.lecs-btn--pdf:hover {
    background: #0a1f6b;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(1,6,48,.25);
}
.lecs-btn--pdf:active { transform: translateY(0); }
.lecs-btn--pdf:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---- Results Column ---- */
.lecs-results-inner { display: flex; flex-direction: column; height: 100%; }

.lecs-results__placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex: 1; gap: .75rem; color: #b0b8d0; text-align: center; padding: 2rem 1rem;
}
.lecs-results__placeholder svg { width: 48px; height: 48px; opacity: .3; }
.lecs-results__placeholder p { font-size: .85rem; }

.lecs-results__main {
    background: var(--lecs-result-bg, #f0f4ff);
    border: 1.5px solid rgba(1,6,48,.1);
    border-radius: var(--lecs-radius, 10px);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}
.lecs-results__badge {
    font-size: .68rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
    color: var(--lecs-primary, #010630); opacity: .7; margin-bottom: .35rem;
}
.lecs-results__hero {
    font-size: 2.2rem; font-weight: 800;
    color: var(--lecs-primary, #010630);
    letter-spacing: -.02em; line-height: 1.1;
    transition: all .3s ease;
}

.lecs-results__grid {
    display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem;
}
.lecs-results__item {
    display: flex; justify-content: space-between; align-items: center;
    padding: .65rem .9rem;
    background: #fff; border-radius: 6px;
    border: 1px solid #eaecf4; gap: .5rem;
}
.lecs-results__item--total {
    background: #f0f4ff; font-weight: 700;
    border-color: rgba(1,6,48,.12);
}
.lecs-results__label { font-size: .8rem; color: #6e7a99; flex: 1; }
.lecs-results__value { font-size: .92rem; font-weight: 700; color: #1e2336; text-align: right; white-space: nowrap; }
.lecs-highlight { color: #ef4444 !important; }
.lecs-positive  { color: #16a34a !important; }

/* ---- Savings Banner ---- */
.lecs-savings-banner {
    display: flex; gap: 0;
    border-radius: var(--lecs-radius, 10px);
    overflow: hidden; margin-bottom: 1rem;
    border: 1.5px solid rgba(1,6,48,.1);
}
.lecs-savings-banner__item { flex: 1; padding: 1.1rem 1rem; text-align: center; background: var(--lecs-result-bg, #f0f4ff); }
.lecs-savings-banner__divider { width: 1.5px; background: rgba(1,6,48,.1); }
.lecs-savings-banner__label {
    font-size: .68rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--lecs-primary, #010630); opacity: .7; margin-bottom: .3rem;
}
.lecs-savings-banner__value { font-size: 1.7rem; font-weight: 800; color: #16a34a; letter-spacing: -.02em; }

/* ---- Success Banner ---- */
.lecs-success-banner {
    display: flex; align-items: flex-start; gap: .9rem;
    background: #f0fdf4; border: 1.5px solid #bbf7d0;
    border-radius: var(--lecs-radius, 10px);
    padding: 1rem 1.25rem; margin-bottom: .75rem;
}
.lecs-success-banner svg { width: 26px; height: 26px; color: #16a34a; flex-shrink: 0; margin-top: .1rem; }
.lecs-success-banner strong { display: block; color: #15803d; margin-bottom: .15rem; font-size: .9rem; }
.lecs-success-banner p { font-size: .82rem; color: #4b7a5b; }

/* ---- LVR Progress ---- */
.lecs-lvr-display {
    background: #f9fafc; border: 1.5px solid #d4d9e8;
    border-radius: calc(var(--lecs-radius, 10px) - 2px);
    padding: .8rem .9rem;
}
.lecs-lvr-display__header {
    display: flex; justify-content: space-between;
    font-size: .8rem; font-weight: 600; color: #3d4461; margin-bottom: .5rem;
}
.lecs-progress {
    position: relative; height: 9px;
    background: #e4e8f0; border-radius: 999px; overflow: visible;
}
.lecs-progress__bar {
    height: 100%; border-radius: 999px; background: #22c55e;
    transition: width .4s ease, background .3s;
}
.lecs-progress__marker {
    position: absolute; top: -4px; transform: translateX(-50%);
    width: 2px; height: 17px; background: #ef4444; border-radius: 1px;
}
.lecs-progress__marker span {
    position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
    font-size: .62rem; color: #ef4444; white-space: nowrap; font-weight: 700;
}

/* ---- Chart ---- */
.lecs-chart-wrap {
    margin-top: auto; padding: 1rem;
    background: #fff; border-radius: 8px;
    border: 1px solid #eaecf4;
}

/* ---- Loading overlay ---- */
.lecs-col-results { position: relative; }
.lecs-calculating {
    position: absolute; inset: 0;
    background: rgba(250,251,255,.75);
    display: flex; align-items: center; justify-content: center;
    border-radius: 0 var(--lecs-radius,10px) var(--lecs-radius,10px) 0;
    z-index: 10; opacity: 0; pointer-events: none;
    transition: opacity .2s;
}
.lecs-calculating.active { opacity: 1; pointer-events: auto; }
.lecs-spinner {
    width: 22px; height: 22px;
    border: 3px solid #d4d9e8;
    border-top-color: var(--lecs-primary, #010630);
    border-radius: 50%;
    animation: lecsSpin .7s linear infinite;
}
@keyframes lecsSpin { to { transform: rotate(360deg); } }

/* ---- Error ---- */
.lecs-error {
    background: #fef2f2; border: 1.5px solid #fecaca;
    border-radius: 8px; padding: .85rem 1rem;
    font-size: .85rem; color: #b91c1c; margin-bottom: .75rem;
}

/* ---- Disclaimer ---- */
.lecs-disclaimer {
    font-size: .73rem; color: #8892ae; margin-top: auto;
    padding-top: .75rem; font-style: italic; text-align: center;
}

/* ---- Result animation ---- */
@keyframes lecsPopIn {
    from { opacity: 0; transform: scale(.97) translateY(6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.lecs-results-animate { animation: lecsPopIn .3s ease; }

/* ---- PDF button in results col ---- */
.lecs-results-actions {
    margin-top: .75rem; display: flex; justify-content: flex-end;
}
