/* ============================================================
   LIGHTHOUSE PROPERTY PRACTITIONER
   UNIFIED CALCULATOR STYLES
   ============================================================

   This file is the sole front-end presentation authority for the
   Lighthouse Property Practitioner calculators.

   Branding and component colours are supplied by CSS variables
   emitted by lighthouse-property-finance.php from LHPF settings.
   ============================================================ */

:root {
    --lhpf-primary: #002b45;
    --lhpf-accent: #f9b233;
    --lhpf-wrapper-bg: #001a2f;
    --lhpf-wrapper-text: #ffffff;
    --lhpf-input-bg: rgba(255,255,255,.12);
    --lhpf-input-text: #ffffff;
    --lhpf-result-bg: #f8f9fa;
    --lhpf-result-text: #1a1a1a;
    --lhpf-table-bg: #ffffff;
    --lhpf-table-text: #1a1a1a;
    --lhpf-table-header-bg: #002b45;
    --lhpf-table-header-text: #ffffff;
    --lhpf-disclaimer-bg: #fef9e7;
    --lhpf-disclaimer-text: #4a3b00;
    --lhpf-button-bg: #f9b233;
    --lhpf-button-text: #001a2f;
    --lhpf-button-hover-bg: #e5a020;
    --lhpf-button-hover-text: #001a2f;
    --lhpf-highlight: #f9b233;
    --lhpf-muted: #666666;
    --lhpf-border: #dddddd;
    --lhpf-success: #28a745;
    --lhpf-danger: #dc3545;
    --lhpf-lead-bg: rgba(255,255,255,.05);
    --lhpf-border-radius: 4px;
}

/* ============================================================
   CALCULATOR WRAPPER
   ============================================================ */

.lhpf-wrapper {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin: 0 auto 2rem;
    padding: 40px;
    box-sizing: border-box;
    background: var(--lhpf-wrapper-bg) !important;
    color: var(--lhpf-wrapper-text) !important;
    border-radius: 28px;
    border: 1px solid color-mix(in srgb, var(--lhpf-accent) 20%, transparent);
    box-shadow: 0 20px 35px -10px rgba(0,0,0,.3);
    font-family: inherit;
}

.lhpf-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--lhpf-accent), var(--lhpf-primary), var(--lhpf-accent));
    border-radius: 28px 28px 0 0;
    pointer-events: none;
}

.lhpf-calculator-container,
.lhpf-bond-transfer-calculator,
.lhpf-monthly-repayment,
.lhpf-deposit-linked,
.lhpf-nca-prequal,
.lhpf-bond-qualifying,
.lhpf-extra-payment,
.lhpf-agent-fee-calculator {
    color: var(--lhpf-wrapper-text);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.lhpf-wrapper h1,
.lhpf-wrapper h2,
.lhpf-wrapper h3,
.lhpf-wrapper h4,
.lhpf-wrapper .lhpf-title {
    color: var(--lhpf-wrapper-text) !important;
}

.lhpf-title {
    font-size: 28px;
    font-weight: 800;
    border-left: 4px solid var(--lhpf-accent);
    padding-left: 20px;
    margin-bottom: 28px;
}

/* ============================================================
   FORMS AND FIELDS
   ============================================================ */

.lhpf-wrapper form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.lhpf-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lhpf-field label,
.lhpf-wrapper label {
    color: var(--lhpf-wrapper-text) !important;
    font-size: 12px;
    font-weight: 700;
}

.lhpf-field label span {
    color: var(--lhpf-accent) !important;
}

.lhpf-wrapper input[type="text"],
.lhpf-wrapper input[type="number"],
.lhpf-wrapper input[type="email"],
.lhpf-wrapper input[type="tel"],
.lhpf-wrapper input[type="date"],
.lhpf-wrapper select,
.lhpf-wrapper textarea {
    width: 100%;
    padding: 14px 18px;
    box-sizing: border-box;
    border-radius: var(--lhpf-border-radius);
    border: 1px solid var(--lhpf-border) !important;
    background: var(--lhpf-input-bg) !important;
    color: var(--lhpf-input-text) !important;
    font-size: 16px;
    font-weight: 500;
    transition: .2s ease;
}

.lhpf-wrapper input::placeholder,
.lhpf-wrapper textarea::placeholder {
    color: color-mix(in srgb, var(--lhpf-input-text) 55%, transparent) !important;
}

.lhpf-wrapper input:hover,
.lhpf-wrapper select:hover,
.lhpf-wrapper textarea:hover {
    border-color: var(--lhpf-accent) !important;
}

.lhpf-wrapper input:focus,
.lhpf-wrapper select:focus,
.lhpf-wrapper textarea:focus {
    outline: none;
    border-color: var(--lhpf-accent) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--lhpf-accent) 20%, transparent);
}

.lhpf-wrapper input[readonly] {
    color: var(--lhpf-highlight) !important;
    background: var(--lhpf-input-bg) !important;
}

.lhpf-wrapper select {
    appearance: auto;
}

.lhpf-wrapper .lhpf-hint,
.lhpf-wrapper .lhpf-field .lhpf-hint {
    color: var(--lhpf-muted) !important;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.lhpf-wrapper button,
.lhpf-wrapper .button,
.lhpf-wrapper input[type="submit"],
.lhpf-wrapper .lhpf-button,
.lhpf-wrapper .button-primary {
    border: none !important;
    background: var(--lhpf-button-bg) !important;
    color: var(--lhpf-button-text) !important;
    font-weight: 800;
    font-size: 14px;
    border-radius: var(--lhpf-border-radius) !important;
    padding: 14px 28px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: .2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    white-space: normal;
    text-align: center;
}

.lhpf-wrapper button:hover,
.lhpf-wrapper .button:hover,
.lhpf-wrapper input[type="submit"]:hover,
.lhpf-wrapper .lhpf-button:hover,
.lhpf-wrapper .button-primary:hover {
    background: var(--lhpf-button-hover-bg) !important;
    color: var(--lhpf-button-hover-text) !important;
}

.lhpf-wrapper .lhpf-button-secondary {
    background: var(--lhpf-accent) !important;
    color: var(--lhpf-button-text) !important;
    border-radius: var(--lhpf-border-radius) !important;
}

/* ============================================================
   RESULTS
   ============================================================ */

.lhpf-result,
.lhpf-results {
    margin-top: 24px;
    padding: 20px 24px;
    border-radius: var(--lhpf-border-radius);
    background: var(--lhpf-result-bg) !important;
    color: var(--lhpf-result-text) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,.12);
}

.lhpf-wrapper .lhpf-result-item {
    background: transparent !important;
    color: var(--lhpf-result-text) !important;
    padding: .6rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--lhpf-result-text) 10%, transparent) !important;
}

.lhpf-wrapper .lhpf-result-label {
    color: var(--lhpf-result-text) !important;
    font-weight: 500;
}

.lhpf-wrapper .lhpf-result-value,
.lhpf-wrapper .lhpf-result-value.currency,
.lhpf-wrapper .lhpf-result-value.highlight {
    color: var(--lhpf-primary) !important;
    font-weight: 700;
}

.lhpf-wrapper .lhpf-result-value.highlight {
    color: var(--lhpf-highlight) !important;
    font-size: 1.2em;
}

.lhpf-wrapper .lhpf-results p,
.lhpf-wrapper .lhpf-results span,
.lhpf-wrapper .lhpf-results strong,
.lhpf-wrapper .lhpf-result p,
.lhpf-wrapper .lhpf-result span,
.lhpf-wrapper .lhpf-result strong {
    color: var(--lhpf-result-text);
}

/* ============================================================
   RESULT TABLES
   ============================================================ */

.lhpf-wrapper table,
.lhpf-result table,
.lhpf-results table,
.lhpf-bank-table,
.lhpf-master-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: var(--lhpf-table-bg) !important;
    color: var(--lhpf-table-text) !important;
}

.lhpf-wrapper table thead,
.lhpf-wrapper table th,
.lhpf-result table thead,
.lhpf-results table thead,
.lhpf-result table th,
.lhpf-results table th,
.lhpf-bank-table th,
.lhpf-master-table th {
    background: var(--lhpf-table-header-bg) !important;
    color: var(--lhpf-table-header-text) !important;
}

.lhpf-wrapper table th,
.lhpf-wrapper table td,
.lhpf-result table th,
.lhpf-result table td,
.lhpf-results table th,
.lhpf-results table td {
    padding: 10px 12px;
}

.lhpf-wrapper table td,
.lhpf-result table td,
.lhpf-results table td,
.lhpf-bank-table td,
.lhpf-master-table td {
    background: var(--lhpf-table-bg) !important;
    color: var(--lhpf-table-text) !important;
}

.lhpf-wrapper table tr:nth-child(even) td {
    background: color-mix(in srgb, var(--lhpf-table-bg) 92%, var(--lhpf-table-text)) !important;
}

.lhpf-result table td:last-child,
.lhpf-results table td:last-child {
    text-align: right;
    font-weight: 800;
    font-family: 'Courier New', monospace;
}

/* ============================================================
   LEAD CAPTURE
   ============================================================ */

.lhpf-lead-wrapper {
    margin-top: 30px;
    padding: 28px;
    border-radius: var(--lhpf-border-radius);
    border: 1px solid var(--lhpf-border);
    background: var(--lhpf-lead-bg) !important;
    color: var(--lhpf-wrapper-text) !important;
}

.lhpf-lead-wrapper h4 {
    color: var(--lhpf-wrapper-text) !important;
    margin-bottom: 20px;
}

.lhpf-lead-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.lhpf-checkbox input,
.lhpf-consent-checkbox input {
    accent-color: var(--lhpf-accent);
}

/* ============================================================
   FIELD GROUPS AND GRIDS
   ============================================================ */

.lhpf-field-group {
    background: color-mix(in srgb, var(--lhpf-wrapper-bg) 80%, #000000) !important;
    border-radius: var(--lhpf-border-radius);
    padding: 20px;
}

.lhpf-field-group-title {
    color: var(--lhpf-accent) !important;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid color-mix(in srgb, var(--lhpf-accent) 30%, transparent);
}

.lhpf-grid-2 {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 20px;
}

.lhpf-grid-3 {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 20px;
}

/* ============================================================
   DISCLAIMERS
   ============================================================ */

.lhpf-wrapper .lhpf-disclaimer,
.lhpf-wrapper .disclaimer,
.lhpf-wrapper .small-text {
    margin-top: 24px;
    padding: 1rem 1.25rem;
    border-top: 1px solid color-mix(in srgb, var(--lhpf-disclaimer-text) 20%, transparent);
    border-left: 4px solid var(--lhpf-accent);
    border-radius: var(--lhpf-border-radius);
    background: var(--lhpf-disclaimer-bg) !important;
    color: var(--lhpf-disclaimer-text) !important;
    font-size: 11px;
    text-align: center;
    opacity: 1 !important;
}

.lhpf-wrapper .lhpf-disclaimer p,
.lhpf-wrapper .lhpf-disclaimer span,
.lhpf-wrapper .lhpf-disclaimer strong,
.lhpf-wrapper .lhpf-disclaimer em,
.lhpf-wrapper .disclaimer p,
.lhpf-wrapper .disclaimer span,
.lhpf-wrapper .disclaimer strong,
.lhpf-wrapper .small-text p,
.lhpf-wrapper .small-text span {
    background: transparent !important;
    color: var(--lhpf-disclaimer-text) !important;
    opacity: 1 !important;
}

/* ============================================================
   CONSENT
   ============================================================ */

.lhpf-wrapper .lhpf-consent {
    background: var(--lhpf-lead-bg) !important;
    color: var(--lhpf-wrapper-text) !important;
    padding: .8rem 1rem;
    border-radius: var(--lhpf-border-radius);
    margin-top: .8rem;
}

.lhpf-wrapper .lhpf-consent label {
    color: var(--lhpf-wrapper-text) !important;
}

/* ============================================================
   COST BREAKDOWN
   ============================================================ */

.lhpf-wrapper .lhpf-cost-breakdown {
    background: var(--lhpf-result-bg) !important;
    color: var(--lhpf-result-text) !important;
}

.lhpf-wrapper .lhpf-cost-breakdown .cost-row {
    color: var(--lhpf-result-text) !important;
}

.lhpf-wrapper .lhpf-cost-breakdown .cost-row.total {
    border-top: 2px solid var(--lhpf-border) !important;
    color: var(--lhpf-primary) !important;
    font-weight: 700;
}

/* ============================================================
   STATUS COLOURS
   ============================================================ */

.lhpf-wrapper .text-success { color: var(--lhpf-success) !important; }
.lhpf-wrapper .text-danger { color: var(--lhpf-danger) !important; }
.lhpf-wrapper .text-warning { color: var(--lhpf-accent) !important; }
.lhpf-wrapper .text-primary { color: var(--lhpf-primary) !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .lhpf-wrapper {
        padding: 24px;
        margin: 0 16px 2rem;
    }
    .lhpf-grid-2,
    .lhpf-grid-3 {
        grid-template-columns: 1fr;
    }
    .lhpf-lead-actions {
        flex-direction: column;
    }
    .lhpf-wrapper button,
    .lhpf-wrapper .button,
    .lhpf-wrapper input[type="submit"] {
        display: flex;
        width: 100%;
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    .lhpf-wrapper {
        padding: 20px;
        margin: 0 12px 2rem;
    }
    .lhpf-title {
        font-size: 20px;
    }
    .lhpf-wrapper input,
    .lhpf-wrapper select,
    .lhpf-wrapper textarea {
        font-size: 14px;
        padding: 12px 14px;
    }
}
