/* AutoPricer Panama - Classy understated theme */

:root {
    --navy: #0f3f61;
    --navy-soft: #2d6f99;
    --olive: #758259;
    --olive-deep: #5f6948;
    --sandal: #8b5a3c;
    --sandal-soft: #f1e4d7;
    --paper: #f3faff;
    --card-bg: #ffffff;
    --text: #163147;
    --text-light: #4f6f84;
    --border: #c7dcec;
    --success: #2c7f5f;
    --warn: #96643f;
    --error: #8e3d39;
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Avenir Next", "Optima", "Palatino", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 92% -6%, rgba(110, 183, 226, 0.32), transparent 35%),
        radial-gradient(circle at 8% 8%, rgba(139, 90, 60, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(225, 243, 255, 0.8) 0%, rgba(243, 250, 255, 0.8) 58%, rgba(255, 255, 255, 0.95) 100%),
        var(--paper);
    color: var(--text);
    line-height: 1.58;
    letter-spacing: 0.002em;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

header {
    background: linear-gradient(115deg, #0b3553 0%, var(--navy) 45%, var(--navy-soft) 100%);
    color: #f9f6ef;
    padding: 2.2rem 0 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(239, 231, 216, 0.18);
    box-shadow: 0 12px 24px rgba(20, 33, 46, 0.2);
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.3rem;
}

header .accent {
    color: var(--sandal);
}

header .subtitle {
    opacity: 0.92;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.header-nav {
    margin-top: 1rem;
}

.header-nav a {
    color: rgba(249, 246, 239, 0.78);
    text-decoration: none;
    margin: 0 0.9rem;
    font-size: 0.92rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
    padding-bottom: 5px;
    transition: all 0.18s ease;
}

.header-nav a:hover,
.header-nav a.active {
    color: #fffdf8;
    border-bottom-color: #d5e7f4;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.4rem;
    margin-top: 2rem;
}

@media (max-width: 820px) {
    .grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr !important;
    }
    .container {
        padding: 0 16px;
    }
}

.card {
    background: linear-gradient(180deg, var(--card-bg) 0%, #fafdff 100%);
    border-radius: var(--radius);
    padding: 1.35rem;
    border: 1px solid var(--border);
    box-shadow: 0 8px 22px rgba(20, 28, 36, 0.06);
}

.card h2,
.card h3 {
    color: var(--navy);
    letter-spacing: 0.01em;
}

.card h2 {
    font-size: 1.28rem;
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
    margin-bottom: 0.95rem;
}

.form-section-title {
    font-size: 0.86rem;
    margin: 0.1rem 0 0.7rem;
    color: var(--navy-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 0.34rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-group select,
.form-group input {
    padding: 0.64rem 0.78rem;
    border: 1px solid #cddfec;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #ffffff;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--navy-soft);
    box-shadow: 0 0 0 3px rgba(45, 111, 153, 0.18);
}

.features-details {
    margin-top: 0.4rem;
    margin-bottom: 1.1rem;
}

.features-details summary {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    padding: 0.42rem 0;
}

.features-details summary:hover {
    color: var(--navy-soft);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.34rem;
    max-height: 260px;
    overflow-y: auto;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f7fbff;
    margin-top: 0.3rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.84rem;
    cursor: pointer;
    color: var(--text);
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--navy);
}

.form-error {
    background: #fff2f1;
    border: 1px solid #e6b4b0;
    color: var(--error);
    padding: 0.62rem 0.76rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.btn-primary {
    width: 100%;
    padding: 0.86rem;
    background: linear-gradient(120deg, var(--navy) 0%, var(--navy-soft) 100%);
    color: #f8f6f1;
    border: none;
    border-radius: 8px;
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.14s ease, filter 0.14s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(0.97);
}

.btn-primary:disabled {
    opacity: 0.62;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.results-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.valuation-hero {
    margin-top: 1.6rem;
}

.valuation-hero .journey-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.valuation-hero .journey-step {
    pointer-events: none;
}

.price-display {
    margin: 1.2rem 0 1rem;
}

.price-main {
    font-size: 3rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.04;
    letter-spacing: -0.02em;
}

.price-range {
    font-size: 1.08rem;
    color: var(--text-light);
    margin-top: 0.42rem;
}

.price-low { color: var(--success); }
.price-high { color: var(--warn); }
.price-separator { margin: 0 0.46rem; color: #9aa1aa; }

.confidence {
    font-size: 0.86rem;
    color: #1f5b7f;
    margin-top: 0.45rem;
    padding: 0.3rem 0.75rem;
    background: #e9f4fc;
    border: 1px solid #c6deee;
    border-radius: 16px;
    display: inline-block;
}

.risk-badge {
    margin: 0.45rem 0 0.95rem;
    padding: 0.56rem 0.92rem;
    border-radius: 8px;
    font-size: 0.84rem;
    text-align: center;
    line-height: 1.45;
    width: 100%;
}

.risk-badge small {
    font-size: 0.77rem;
    opacity: 0.88;
}

.risk-low {
    background: #eef5ed;
    border: 1px solid #c7d8c2;
    color: #355a39;
}

.risk-medium {
    background: #fdf7eb;
    border: 1px solid #e9d3ab;
    color: #805b1f;
}

.risk-high,
.risk-insufficient_data {
    background: #fff2f1;
    border: 1px solid #e8bab6;
    color: #7f3733;
}

.fast-sale-box {
    margin: 0.38rem 0 1rem;
    padding: 0.65rem 0.85rem;
    width: 100%;
    border-radius: 8px;
    border: 1px solid #ddc7b8;
    background: #fdf8f4;
    color: #6f4a33;
    text-align: left;
    font-size: 0.88rem;
    line-height: 1.42;
    border-left: 4px solid var(--sandal);
}

.price-bar-container {
    width: 100%;
    margin: 1.35rem 0;
}

.price-bar {
    height: 8px;
    background: linear-gradient(90deg, #3f84ad 0%, #8cc0df 52%, #8b5a3c 100%);
    border-radius: 4px;
    position: relative;
}

.price-bar-fill {
    height: 100%;
    border-radius: 4px 0 0 4px;
    position: absolute;
    left: 0;
    top: 0;
}

.price-bar-marker {
    width: 4px;
    height: 20px;
    background: var(--navy);
    border-radius: 2px;
    position: absolute;
    top: -6px;
    transform: translateX(-50%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.price-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.74rem;
    color: var(--text-light);
    margin-top: 0.28rem;
}

.summary {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
    text-align: left;
    width: 100%;
    font-size: 0.9rem;
    color: var(--text-light);
}

.summary strong {
    color: var(--navy);
}

.model-info {
    margin-top: 1.4rem;
    margin-bottom: 1.9rem;
}

.model-info h3 {
    font-size: 1.08rem;
    margin-bottom: 0.95rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.9rem;
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat {
    text-align: center;
    padding: 0.78rem;
    background: #f4f9fe;
    border-radius: 8px;
    border: 1px solid #d7e6f2;
}

.stat-value {
    font-size: 1.34rem;
    font-weight: 700;
    color: var(--navy);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

.insights-card {
    margin-bottom: 1.45rem;
    margin-top: 1.35rem;
}

.insights-hero {
    margin-top: 1.5rem;
    border: 1px solid #c7ddec;
    background:
        linear-gradient(120deg, rgba(15, 63, 97, 0.05) 0%, rgba(139, 90, 60, 0.08) 100%),
        #fbfeff;
}

.insights-kicker {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--olive);
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.insights-hero h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.insights-hero p {
    color: var(--text-light);
    max-width: 760px;
}

.journey-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
    margin-top: 1rem;
}

.journey-step {
    border: 1px solid #c7ddec;
    background: #f4faff;
    color: #3f4f60;
    border-radius: 999px;
    padding: 0.46rem 0.68rem;
    font-size: 0.79rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.journey-step:hover {
    border-color: var(--navy-soft);
    color: var(--navy-soft);
}

.journey-step.is-active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.phase-panel {
    display: none;
}

.phase-panel.is-active {
    display: block;
    animation: panelFade 260ms ease;
}

@keyframes panelFade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.phase-head h3 {
    margin-bottom: 0.25rem;
    color: var(--navy);
}

.insight-divider {
    height: 1px;
    width: 100%;
    margin: 0.8rem 0 1rem;
    background: linear-gradient(90deg, rgba(15, 63, 97, 0.24), rgba(139, 90, 60, 0.16), transparent);
}

.phase-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.phase-actions-end {
    justify-content: flex-start;
}

.btn-next-phase {
    border: 1px solid var(--navy);
    background: var(--navy);
    color: #fff;
    border-radius: 999px;
    padding: 0.5rem 0.95rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-next-phase:hover {
    filter: brightness(1.08);
}

.subsection-title {
    margin: 0.15rem 0 0.75rem;
    color: var(--navy);
    font-size: 1rem;
}

.chart-description {
    color: var(--text-light);
    font-size: 0.89rem;
    margin-top: -0.54rem;
    margin-bottom: 0.9rem;
}

.chart-container {
    position: relative;
    height: 330px;
    width: 100%;
    border: 1px solid #c7ddec;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f4faff 100%);
    padding: 0.55rem;
}

.chart-container-tall {
    height: 400px;
}

.chart-empty-note {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
    color: var(--text-light);
    font-size: 0.9rem;
    background: rgba(248, 252, 255, 0.9);
    border-radius: 10px;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
    flex-wrap: wrap;
}

.brand-insights-controls {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.9rem;
}

.brand-insights-controls label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.brand-insights-controls select {
    min-width: 220px;
    padding: 0.5rem 0.7rem;
    border: 1px solid #cddfec;
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font-size: 0.9rem;
}

.brand-insights-controls select:focus {
    outline: none;
    border-color: var(--navy-soft);
    box-shadow: 0 0 0 3px rgba(45, 111, 153, 0.18);
}

.brand-insights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

@media (max-width: 900px) {
    .brand-insights-grid {
        grid-template-columns: 1fr;
    }
}

.btn-tab {
    padding: 0.4rem 0.95rem;
    border: 1px solid #c9dfed;
    border-radius: 20px;
    background: #f7fbff;
    color: var(--text-light);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.16s ease;
}

.btn-tab:hover {
    border-color: var(--navy-soft);
    color: var(--navy-soft);
}

.btn-tab.active {
    background: var(--navy);
    color: #f9f7f2;
    border-color: var(--navy);
}

.risk-table-wrap {
    overflow-x: auto;
}

.risk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.risk-table thead tr {
    border-bottom: 2px solid var(--border);
}

.risk-table th {
    background: #eef6fd;
    padding: 0.62rem 0.8rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
}

.risk-table td {
    padding: 0.52rem 0.8rem;
    border-bottom: 1px solid var(--border);
    color: #223042;
}

.risk-table tr:hover td {
    background: #f6fbff;
}

.risk-pill {
    display: inline-block;
    padding: 0.22rem 0.62rem;
    border-radius: 12px;
    font-size: 0.77rem;
    font-weight: 700;
    white-space: nowrap;
}

.risk-tier-low {
    background: #eef5ed;
    border: 1px solid #c7d8c2;
    color: #355a39;
}

.risk-tier-medium {
    background: #fdf7eb;
    border: 1px solid #e9d3ab;
    color: #805b1f;
}

.risk-tier-high {
    background: #fff2f1;
    border: 1px solid #e8bab6;
    color: #7f3733;
}

.risk-tier-insufficient_data,
.risk-tier-unknown {
    background: #f1f2f2;
    border: 1px solid #d2d4d7;
    color: #636b76;
}

.index-summary {
    margin-top: 0.78rem;
    padding: 0.78rem 0.95rem;
    background: #f4f9fe;
    border: 1px solid #cfe2f0;
    border-radius: 8px;
    font-size: 0.86rem;
    color: #384656;
    line-height: 1.55;
}

.liquidity-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    gap: 0.72rem;
    margin-bottom: 1rem;
}

.liquidity-stat {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f5faff;
    padding: 0.68rem 0.78rem;
}

.liquidity-stat .value {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.08;
}

.liquidity-stat .label {
    font-size: 0.74rem;
    margin-top: 0.2rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

@media (max-width: 768px) {
    .liquidity-summary-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
    .journey-nav {
        grid-template-columns: 1fr 1fr;
    }
    .valuation-hero .journey-nav {
        grid-template-columns: 1fr;
    }
}

footer {
    text-align: center;
    padding: 1.45rem 0;
    color: #6a7280;
    font-size: 0.84rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.muted-text {
    color: var(--text-light);
}

.is-hidden {
    display: none !important;
}
