/**
 * investor-profile.css — Investor Profile modal styles
 * Batch 49: Preferences, financing defaults, deal score personalization.
 *
 * All colors via CSS custom properties from base.css — zero hardcoded values.
 */

/* ============================================================
   MODAL PANEL OVERRIDE
   Widen the settings modal panel for the full profile form.
   ============================================================ */

#lf-settings-modal .ip-modal-panel,
#lf-settings-modal.lf-modal-overlay .lf-modal-panel {
    width: 560px;
    max-width: calc(100vw - 32px);
    overflow: visible; /* inner handles scroll */
}

/* ============================================================
   MODAL INNER WRAPPER
   ============================================================ */

.ip-modal-inner {
    max-width: 520px;
    margin: 0 auto;
    padding: 24px;
    overflow-y: auto;
    max-height: 80vh;
    box-sizing: border-box;
}

/* ============================================================
   MODAL HEADER
   ============================================================ */

.ip-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ip-modal-title {
    font-family: var(--font-heading);
    font-size: var(--text-md);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    letter-spacing: var(--tracking-wide);
    margin: 0;
}

.ip-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: var(--text-sm);
    transition: color 0.18s ease, background 0.18s ease;
}

.ip-modal-close:hover {
    color: var(--text-primary);
    background: var(--glass-bg-hover);
}

/* ============================================================
   SECTIONS
   ============================================================ */

.ip-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
}

.ip-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.ip-section-title {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 12px 0;
}

/* ============================================================
   FIELDS
   ============================================================ */

.ip-field {
    margin-bottom: 14px;
}

.ip-field:last-child {
    margin-bottom: 0;
}

.ip-field--inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ip-field--inline .ip-label {
    flex: 1;
    margin-bottom: 0;
    white-space: nowrap;
}

.ip-field--inline .ip-input-suffix-wrap,
.ip-field--inline .ip-input {
    flex-shrink: 0;
}

/* ============================================================
   LABELS
   ============================================================ */

.ip-label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: var(--weight-medium);
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
}

/* ============================================================
   TEXT / NUMBER INPUTS
   ============================================================ */

.ip-input {
    width: 100%;
    height: 40px;
    border: 1.5px solid var(--glass-border);
    border-radius: 6px;
    padding: 0 12px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--surface-card);
    box-sizing: border-box;
    transition: border-color 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
}

.ip-input:focus {
    border-color: var(--gold-500);
    outline: none;
    box-shadow: 0 0 0 2px var(--gold-alpha-20);
}

.ip-input[readonly] {
    background: var(--surface-dark-2);
    color: var(--text-muted);
    cursor: default;
    border-color: var(--glass-border);
}

.ip-input[readonly]:focus {
    border-color: var(--glass-border);
    box-shadow: none;
}

.ip-input--short {
    width: 72px;
}

.ip-input--currency {
    width: 140px;
}

/* ============================================================
   INPUT + SUFFIX WRAPPER
   ============================================================ */

.ip-input-suffix-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.ip-suffix {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 6px;
    white-space: nowrap;
}

/* ============================================================
   SLIDERS
   ============================================================ */

.ip-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--glass-border);
    accent-color: var(--gold-500);
    cursor: pointer;
    outline: none;
    margin: 6px 0;
}

.ip-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold-500);
    cursor: pointer;
    border: 2px solid var(--surface-dark);
    box-shadow: 0 0 0 2px var(--gold-alpha-30);
}

.ip-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold-500);
    cursor: pointer;
    border: 2px solid var(--surface-dark);
}

/* ============================================================
   STRATEGY CHIPS
   ============================================================ */

.ip-strategy-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ip-chip {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: transparent;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
    white-space: nowrap;
}

.ip-chip:hover {
    border-color: var(--gold-alpha-50);
    color: var(--text-primary);
    background: var(--gold-alpha-10);
}

.ip-chip.is-active {
    background: var(--gold-500);
    border-color: var(--gold-500);
    color: var(--text-inverse);
    font-weight: var(--weight-semibold);
}

/* ============================================================
   SEGMENTED CONTROLS
   ============================================================ */

.ip-segmented {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
}

.ip-segmented--wrap {
    flex-wrap: wrap;
    gap: 6px;
}

/* Flush segmented (loan term) */
.ip-segmented:not(.ip-segmented--wrap) .ip-seg-btn {
    border-radius: 0;
    border-right-width: 0;
}

.ip-segmented:not(.ip-segmented--wrap) .ip-seg-btn:first-child {
    border-radius: 6px 0 0 6px;
}

.ip-segmented:not(.ip-segmented--wrap) .ip-seg-btn:last-child {
    border-radius: 0 6px 6px 0;
    border-right-width: 1px;
}

/* Wrapped segmented (rehab market) — each button is standalone pill */
.ip-segmented--wrap .ip-seg-btn {
    border-radius: 6px;
}

.ip-seg-btn {
    padding: 6px 14px;
    border: 1px solid var(--glass-border);
    background: transparent;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
    white-space: nowrap;
}

.ip-seg-btn:hover:not(.is-active) {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.ip-seg-btn.is-active {
    background: var(--blue-steel);
    border-color: var(--blue-steel);
    color: var(--text-primary);
    font-weight: var(--weight-semibold);
}

/* ============================================================
   ACTIONS
   ============================================================ */

.ip-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
}

.ip-btn-cancel {
    width: 100%;
    height: 40px;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    cursor: pointer;
    margin-bottom: 8px;
    transition: background 0.16s ease, color 0.16s ease;
}

.ip-btn-cancel:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.ip-btn-save {
    width: 100%;
    height: 44px;
    background: var(--gold-500);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: var(--weight-semibold);
    color: var(--text-inverse);
    cursor: pointer;
    letter-spacing: var(--tracking-wide);
    transition: background 0.16s ease, box-shadow 0.16s ease;
}

.ip-btn-save:hover {
    background: var(--gold-400);
    box-shadow: var(--glow-gold-sm);
}

.ip-btn-save:active {
    background: var(--gold-600);
}

/* ============================================================
   ROI NOTE — injected by investor-profile.js
   ============================================================ */

.ip-roi-note {
    font-size: 0.72rem;
    color: var(--color-warning);
    font-style: italic;
    margin-left: 4px;
}

/* ============================================================
   RESPONSIVE — MOBILE (≤ 640px)
   ============================================================ */

@media (max-width: 640px) {
    #lf-settings-modal.lf-modal-overlay {
        align-items: flex-end;
        justify-content: center;
        padding: 0;
    }

    #lf-settings-modal .ip-modal-panel,
    #lf-settings-modal.lf-modal-overlay .lf-modal-panel {
        width: 100%;
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .ip-modal-inner {
        padding: 16px;
        max-height: 82vh;
        overflow-y: auto;
    }

    .ip-field--inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .ip-field--inline .ip-label {
        margin-bottom: 4px;
    }

    .ip-input--short,
    .ip-input--currency {
        width: 100%;
    }

    .ip-strategy-chips {
        gap: 6px;
    }

    .ip-chip {
        font-size: 0.75rem;
        padding: 5px 11px;
    }

    .ip-seg-btn {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
}
