/* HELOC Calculator - Teal/Navy Theme */
:root {
    --teal: #00b4a6;
    --teal-dark: #008f84;
    --navy: #1a2b4a;
    --navy-light: #243556;
    --white: #ffffff;
    --gray-bg: #f5f7fa;
    --gray-border: #e0e6ed;
    --text-dark: #1a2b4a;
    --text-muted: #6b7c99;
    --shadow: 0 4px 20px rgba(26,43,74,0.1);
}

.heloc-wrap * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', sans-serif; }

.heloc-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    color: var(--text-dark);
}

/* Currency Bar */
.heloc-currency-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--navy);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.heloc-currency-bar select {
    background: var(--navy-light);
    color: #fff;
    border: 1px solid var(--teal);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

/* Tabs */
.heloc-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--gray-bg);
    padding: 6px;
    border-radius: 10px;
    flex-wrap: wrap;
}

.heloc-tab {
    flex: 1;
    min-width: 120px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.heloc-tab.active, .heloc-tab:hover {
    background: var(--navy);
    color: #fff;
}

.heloc-tab.active { background: var(--teal); }

/* Panels */
.heloc-panel { display: none; }
.heloc-panel.active { display: block; }

/* Grid */
.heloc-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.heloc-inputs { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 16px; }

.heloc-results {
    flex: 1.5;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Cards */
.heloc-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-border);
}

.heloc-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--teal);
}

/* Fields */
.heloc-field { margin-bottom: 16px; }

.heloc-field label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.heloc-field label span {
    color: var(--teal);
    font-weight: 700;
}

.heloc-field input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    height: 6px;
    background: linear-gradient(to right, var(--teal) 0%, var(--teal) 50%, var(--gray-border) 50%);
    border-radius: 3px;
    margin-bottom: 8px;
    cursor: pointer;
}

.heloc-field input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--navy);
    border-radius: 50%;
    border: 3px solid var(--teal);
    cursor: pointer;
}

.heloc-field input[type="number"],
.heloc-field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-dark);
    background: var(--gray-bg);
    transition: border-color 0.3s;
}

.heloc-field input[type="number"]:focus,
.heloc-field select:focus {
    outline: none;
    border-color: var(--teal);
}

/* Result Hero */
.heloc-result-hero {
    background: var(--navy);
    border-radius: 12px;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.heloc-hero-item { text-align: center; }

.heloc-hero-label {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.heloc-hero-value {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.heloc-hero-value.teal { color: var(--teal); }

/* Equity Bar */
.heloc-equity-bar-wrap { background: #fff; border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.heloc-equity-bar-wrap h4 { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 12px; }

.heloc-equity-bar {
    display: flex;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.heloc-bar-mort {
    background: var(--navy);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    transition: width 0.6s ease;
}

.heloc-bar-heloc {
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    transition: width 0.6s ease;
}

.heloc-bar-equity {
    background: var(--teal);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    transition: width 0.6s ease;
}

.heloc-equity-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.heloc-equity-labels b { color: var(--text-dark); }

/* Table */
.heloc-table-wrap { overflow-x: auto; }

.heloc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.heloc-table th {
    background: var(--navy);
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
}

.heloc-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-border);
    color: var(--text-dark);
}

.heloc-table tr:nth-child(even) td { background: var(--gray-bg); }
.heloc-table tr:hover td { background: rgba(0,180,166,0.08); }

.phase-draw td:first-child { border-left: 3px solid var(--teal); }
.phase-repay td:first-child { border-left: 3px solid var(--navy); }

/* Info Box */
.heloc-info-box {
    background: var(--gray-bg);
    border-left: 4px solid var(--teal);
    border-radius: 8px;
    padding: 14px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-dark);
    margin-top: 12px;
}

/* Qualify */
.qualify-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}

.qualify-pass { background: rgba(0,180,166,0.1); color: #008f84; border-left: 4px solid var(--teal); }
.qualify-warn { background: rgba(255,193,7,0.1); color: #856404; border-left: 4px solid #ffc107; }
.qualify-fail { background: rgba(231,76,60,0.1); color: #c0392b; border-left: 4px solid #e74c3c; }

/* Exports */
.heloc-exports {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-border);
}

.heloc-exports button {
    padding: 10px 20px;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.heloc-exports button:hover { background: var(--teal); transform: translateY(-2px); }

/* Responsive */
@media (max-width: 768px) {
    .heloc-grid { flex-direction: column; }
    .heloc-result-hero { grid-template-columns: 1fr; }
    .heloc-hero-value { font-size: 16px; }
    .heloc-tabs { flex-direction: column; }
}
