/*!
 * Ontario Land Transfer Tax Calculator - Lama Law
 * All selectors are prefixed with "lltc-" so they cannot clash with
 * the theme (main.css). Colours and fonts reuse the theme's variables.
 */

.lltc {
    --lltc-primary: var(--tp-theme-primary, #01889F);
    --lltc-primary-dark: #016d80;
    --lltc-primary-tint: #e8f5f7;
    --lltc-heading: var(--tp-heading-primary, #12062c);
    --lltc-text: var(--tp-text-body, #67677a);
    --lltc-border: #dfe3ea;
    --lltc-surface: #ffffff;
    --lltc-muted-bg: #f6f7f9;
    --lltc-error: #c62828;
    --lltc-radius: 14px;
    --lltc-shadow: 0 10px 40px rgba(18, 6, 44, 0.07);

    font-family: var(--tp-ff-body, "DM Sans", sans-serif);
    color: var(--lltc-text);
}

.lltc *,
.lltc *::before,
.lltc *::after {
    box-sizing: border-box;
}

/* ---------- Intro ---------- */
.lltc-intro {
    max-width: 760px;
    margin: 0 auto 50px;
    text-align: center;
}
.lltc-eyebrow {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lltc-primary);
    margin-bottom: 10px;
}
.lltc-intro h2 {
    font-family: var(--tp-ff-heading, "Plus Jakarta Sans", sans-serif);
    color: var(--lltc-heading);
    font-size: 40px;
    line-height: 1.2;
    letter-spacing: -1px;
    margin-bottom: 16px;
}
.lltc-intro p {
    margin-bottom: 0;
}

/* ---------- Layout ---------- */
.lltc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}
@media (min-width: 992px) {
    .lltc-grid {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
        gap: 30px;
    }
}

.lltc-card {
    background: var(--lltc-surface);
    border: 1px solid var(--lltc-border);
    border-radius: var(--lltc-radius);
    box-shadow: var(--lltc-shadow);
    padding: 24px 20px;
    min-width: 0;
}
@media (min-width: 576px) {
    .lltc-card { padding: 32px; }
}

.lltc-card__title {
    font-family: var(--tp-ff-heading, "Plus Jakarta Sans", sans-serif);
    color: var(--lltc-heading);
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.lltc-card__title i {
    color: var(--lltc-primary);
    font-size: 20px;
}

/* ---------- Form fields ---------- */
.lltc-field {
    margin: 0 0 24px;
    border: 0;
    padding: 0;
    min-width: 0;
}
.lltc-field:last-child { margin-bottom: 0; }

.lltc-label {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: var(--lltc-heading);
    margin-bottom: 8px;
    line-height: 1.4;
    padding: 0;
}

.lltc-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.lltc-input-prefix,
.lltc-input-suffix {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: var(--lltc-heading);
    pointer-events: none;
}
.lltc-input-prefix { left: 16px; font-size: 18px; }
.lltc-input-suffix { right: 16px; font-size: 13px; color: var(--lltc-text); letter-spacing: 0.05em; }

.lltc .lltc-input {
    width: 100%;
    height: 56px;
    padding: 0 60px 0 36px;
    font-family: inherit;
    font-size: 18px;
    font-weight: 600;
    color: var(--lltc-heading);
    background: var(--lltc-surface);
    border: 1.5px solid var(--lltc-border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}
.lltc .lltc-input::placeholder { color: #a7abb5; font-weight: 400; }
.lltc .lltc-input:hover { border-color: #c4cad4; }
.lltc .lltc-input:focus {
    border-color: var(--lltc-primary);
    box-shadow: 0 0 0 4px rgba(1, 136, 159, 0.14);
}
.lltc-field--error .lltc-input,
.lltc-field--error .lltc-input:focus {
    border-color: var(--lltc-error);
    box-shadow: 0 0 0 4px rgba(198, 40, 40, 0.1);
}
.lltc-error {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    color: var(--lltc-error);
    font-size: 14px;
    line-height: 1.4;
    margin: 8px 0 0;
}
.lltc-error[hidden] { display: none; }
.lltc-help {
    font-size: 13px;
    line-height: 1.5;
    margin: 8px 0 0;
}

/* Segmented location toggle (radio buttons) */
.lltc-segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 5px;
    background: var(--lltc-muted-bg);
    border: 1px solid var(--lltc-border);
    border-radius: 12px;
}
.lltc-segmented__option { position: relative; margin: 0; }
.lltc-segmented__option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.lltc-segmented__option span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 8px 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.25;
    text-align: center;
    color: var(--lltc-text);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.lltc-segmented__option span:hover { color: var(--lltc-heading); }
.lltc-segmented__option input:checked + span {
    background: var(--lltc-surface);
    color: var(--lltc-primary);
    box-shadow: 0 2px 8px rgba(18, 6, 44, 0.1);
}
.lltc-segmented__option input:focus-visible + span {
    outline: 2px solid var(--lltc-primary);
    outline-offset: 2px;
}

/* Custom checkbox */
.lltc-check {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    border: 1.5px solid var(--lltc-border);
    border-radius: 12px;
    cursor: pointer;
    margin: 0;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.lltc-check:hover { border-color: #c4cad4; }
.lltc-check input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.lltc-check__box {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin-top: 1px;
    border: 2px solid #b9bfca;
    border-radius: 6px;
    background: var(--lltc-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.lltc-check__box svg {
    width: 14px;
    height: 14px;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.lltc-check input:checked ~ .lltc-check__box {
    background: var(--lltc-primary);
    border-color: var(--lltc-primary);
}
.lltc-check input:checked ~ .lltc-check__box svg { opacity: 1; transform: scale(1); }
.lltc-check input:focus-visible ~ .lltc-check__box {
    outline: 2px solid var(--lltc-primary);
    outline-offset: 2px;
}
.lltc-check:has(input:checked) {
    border-color: var(--lltc-primary);
    background: var(--lltc-primary-tint);
}
.lltc-check__text { line-height: 1.45; }
.lltc-check__text strong {
    display: block;
    color: var(--lltc-heading);
    font-size: 15px;
    font-weight: 600;
}
.lltc-check__text small {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: var(--lltc-text);
    margin-top: 3px;
}

.lltc-reset {
    background: none;
    border: 0;
    padding: 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--lltc-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.lltc-reset:hover { color: var(--lltc-primary-dark); text-decoration: underline; }

/* ---------- Results ---------- */
.lltc-results__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.lltc-group {
    border: 1px solid var(--lltc-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}
.lltc-group[hidden] { display: none; }
.lltc-group__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--lltc-heading);
    background: var(--lltc-muted-bg);
    border-bottom: 1px solid var(--lltc-border);
}
.lltc-group__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--lltc-primary);
    flex: 0 0 10px;
}
.lltc-group--municipal .lltc-group__dot { background: var(--lltc-heading); }

.lltc-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 12px 16px;
    line-height: 1.4;
    font-size: 15px;
}
.lltc-row + .lltc-row { border-top: 1px dashed var(--lltc-border); }
.lltc-row[hidden] { display: none; }
.lltc-row__label { min-width: 0; }
.lltc-row__value {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--lltc-heading);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}
.lltc-row--rebate .lltc-row__value { color: #2e7d32; }
.lltc-row--subtotal { background: #fbfcfd; }
.lltc-row--subtotal .lltc-row__label { font-weight: 600; color: var(--lltc-heading); }
.lltc-row--price {
    border: 1px solid var(--lltc-border);
    border-radius: 12px;
    margin-bottom: 16px;
}

.lltc-total {
    margin-top: 8px;
    padding: 22px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--lltc-primary) 0%, var(--lltc-primary-dark) 100%);
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 16px;
}
.lltc-total__label {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.92;
    line-height: 1.4;
}
.lltc-total__note {
    display: block;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    opacity: 0.85;
    margin-top: 2px;
}
.lltc-total__value {
    font-family: var(--tp-ff-heading, "Plus Jakarta Sans", sans-serif);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
@media (min-width: 576px) {
    .lltc-total { padding: 24px 26px; }
    .lltc-total__value { font-size: 36px; }
}
.lltc-results.is-empty .lltc-total { background: #8a9aa3; }
.lltc-results.is-empty .lltc-row__value { color: #a7abb5; }

/* Breakdown (collapsible) */
.lltc-breakdown {
    margin-top: 20px;
    border: 1px solid var(--lltc-border);
    border-radius: 12px;
}
.lltc-breakdown summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 15px;
    color: var(--lltc-heading);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.lltc-breakdown summary::-webkit-details-marker { display: none; }
.lltc-breakdown summary::after {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--lltc-primary);
    border-bottom: 2px solid var(--lltc-primary);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-top: -4px;
}
.lltc-breakdown[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.lltc-breakdown__body { padding: 0 16px 16px; }
.lltc-breakdown__title {
    font-weight: 700;
    color: var(--lltc-heading);
    font-size: 14px;
    margin: 12px 0 6px;
    line-height: 1.4;
}
.lltc-breakdown__empty { font-size: 14px; margin: 0; line-height: 1.5; }
.lltc-breakdown__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}
.lltc-breakdown__table th,
.lltc-breakdown__table td {
    padding: 7px 4px;
    border-bottom: 1px solid var(--lltc-border);
    text-align: left;
}
.lltc-breakdown__table th:last-child,
.lltc-breakdown__table td:last-child { text-align: right; white-space: nowrap; }
.lltc-breakdown__table thead th {
    font-weight: 600;
    color: var(--lltc-heading);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.lltc-breakdown__table tr.is-empty td { color: #a7abb5; }
.lltc-breakdown__table tfoot th,
.lltc-breakdown__table tfoot td {
    font-weight: 700;
    color: var(--lltc-heading);
    border-bottom: 0;
}

.lltc-disclaimer {
    margin: 20px 0 0;
    font-size: 13px;
    line-height: 1.55;
}

/* ---------- Info section below the calculator ---------- */
.lltc-info {
    margin-top: 70px;
}
.lltc-info h3 {
    font-family: var(--tp-ff-heading, "Plus Jakarta Sans", sans-serif);
    color: var(--lltc-heading);
    font-size: 26px;
    line-height: 1.3;
    margin-bottom: 14px;
}
.lltc-info p { margin-bottom: 16px; }
.lltc-rates-table-wrap { overflow-x: auto; margin-bottom: 30px; }
.lltc-rates-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--lltc-surface);
    border: 1px solid var(--lltc-border);
    border-radius: 12px;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.4;
}
.lltc-rates-table th,
.lltc-rates-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--lltc-border);
    text-align: left;
}
.lltc-rates-table td:last-child,
.lltc-rates-table th:last-child { text-align: right; }
.lltc-rates-table thead th {
    background: var(--lltc-heading);
    color: #fff;
    font-weight: 600;
}
.lltc-rates-table tbody tr:last-child td { border-bottom: 0; }
.lltc-rates-table tbody tr:nth-child(even) { background: var(--lltc-muted-bg); }

.lltc-cta {
    margin-top: 40px;
    padding: 30px 24px;
    border-radius: var(--lltc-radius);
    background: var(--lltc-primary-tint);
    border: 1px solid #cde8ed;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.lltc-cta h4 {
    font-family: var(--tp-ff-heading, "Plus Jakarta Sans", sans-serif);
    color: var(--lltc-heading);
    font-size: 22px;
    margin: 0 0 6px;
}
.lltc-cta p { margin: 0; }

/* ---------- Mobile tweaks ---------- */
@media (max-width: 575px) {
    .lltc-intro { margin-bottom: 32px; }
    .lltc-intro h2 { font-size: 30px; }
    .lltc-row { font-size: 14px; padding: 11px 14px; }
    .lltc-segmented__option span { font-size: 14px; }
    .lltc-segmented__option span i { display: none; }
    .lltc-info { margin-top: 50px; }
    .lltc-info h3 { font-size: 22px; }
    .lltc-rates-table th, .lltc-rates-table td { padding: 12px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .lltc * { transition: none !important; }
}
