/* ============================================================================
   Jackson Hole Development Guide — Shared Styles
   ============================================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand palette */
    --brand-start: #2b6cb0;
    --brand-end: #2d3748;
    --brand-gradient: linear-gradient(135deg, var(--brand-start) 0%, var(--brand-end) 100%);
    --brand-accent: #2b6cb0;

    /* Neutrals */
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;

    /* Semantic */
    --success: #48bb78;
    --success-bg: #c6f6d5;
    --success-text: #22543d;
    --warning: #ed8936;
    --warning-bg: #fefcbf;
    --warning-text: #744210;
    --danger: #f56565;
    --danger-bg: #fed7d7;
    --danger-text: #742a2a;
    --info: #4299e1;
    --info-bg: #bee3f8;
    --info-text: #2c5282;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50px;
}

body {
    font-family: var(--font-family);
    color: var(--gray-700);
    line-height: 1.6;
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-accent); }
a:hover { text-decoration: underline; }

/* --- Layout shells --- */
.page-centered {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: var(--brand-gradient);
}

.card {
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
    width: 100%;
}

.card--narrow { max-width: 640px; padding: 40px 36px; }
.card--wide   { max-width: 1040px; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: var(--text-base);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, background .15s;
    text-decoration: none;
    line-height: 1;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
    background: var(--brand-gradient);
    color: #fff;
    padding: 16px 36px;
    box-shadow: 0 8px 24px rgba(43,108,176,.35);
}
.btn--primary:hover { box-shadow: 0 12px 32px rgba(43,108,176,.45); }

.btn--secondary {
    background: var(--gray-200);
    color: var(--gray-700);
    padding: 14px 28px;
}
.btn--secondary:hover { background: var(--gray-300); }

.btn--ghost {
    background: transparent;
    color: var(--gray-400);
    border: 2px solid var(--gray-200);
    padding: 12px 24px;
    font-size: var(--text-sm);
}
.btn--ghost:hover { border-color: var(--gray-300); color: var(--gray-500); }

.btn--block { width: 100%; }

/* --- Form elements --- */
.input-group { margin-bottom: 20px; }

.input-group label {
    display: block;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
    font-size: var(--text-sm);
}

.input-field {
    width: 100%;
    padding: 14px 18px;
    font-size: var(--text-base);
    font-family: var(--font-family);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}

.input-field:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(43,108,176,.12);
}

select.input-field {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23718096' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.help-text {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: 8px;
}

/* --- Radio / Checkbox options --- */
.option-card {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    display: flex;
    align-items: center;
    gap: 14px;
}

.option-card:hover {
    border-color: var(--brand-accent);
    background: var(--gray-100);
}

.option-card:has(input:checked) {
    border-color: var(--brand-accent);
    background: #ebf4ff;
}

.option-card input[type="radio"],
.option-card input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--brand-accent);
}

.option-card span {
    cursor: pointer;
    font-size: var(--text-base);
    color: var(--gray-700);
    flex: 1;
    line-height: 1.4;
}

/* --- Alerts --- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    font-size: var(--text-sm);
    line-height: 1.5;
    border-left: 4px solid;
}

.alert--success { background: var(--success-bg); border-color: var(--success); color: var(--success-text); }
.alert--warning { background: #fff8e1; border-color: var(--warning); color: var(--warning-text); }
.alert--danger  { background: var(--danger-bg); border-color: var(--danger); color: var(--danger-text); }
.alert--info    { background: var(--info-bg); border-color: var(--info); color: var(--info-text); }

.alert strong { font-weight: 700; }

/* --- Progress bar --- */
.progress-track {
    height: 6px;
    background: var(--gray-200);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 32px;
}

.progress-fill {
    height: 100%;
    background: var(--brand-gradient);
    border-radius: 6px;
    transition: width .35s ease;
}

/* --- Property context bar (shows during question flow) --- */
.context-bar {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin-bottom: 28px;
    font-size: var(--text-sm);
}

.context-bar__item {
    display: flex;
    gap: 6px;
}

.context-bar__label { color: var(--gray-500); }
.context-bar__value { color: var(--gray-700); font-weight: 600; }

/* --- Info boxes (results page) --- */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.info-box {
    background: var(--gray-50);
    padding: 18px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--brand-accent);
}

.info-box__label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
}

.info-box__value {
    font-size: var(--text-2xl);
    color: var(--gray-700);
    font-weight: 700;
}

.info-box__value--highlight { color: var(--success); }
.info-box__value--danger    { color: var(--danger); }

.info-box__note {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin-top: 6px;
}

/* --- Property card (lookup confirmation) --- */
.property-card {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 22px;
    margin-bottom: 20px;
    border: 2px solid var(--gray-200);
}

.property-card h3 {
    color: var(--gray-700);
    margin-bottom: 16px;
    font-size: var(--text-lg);
}

.property-field {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: var(--text-sm);
}

.property-field:last-child { border-bottom: none; }
.property-field .label { font-weight: 600; color: var(--gray-600); }
.property-field .value { color: var(--gray-700); text-align: right; }

/* --- Autocomplete dropdown --- */
.autocomplete-container { position: relative; }

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid var(--brand-accent);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
    display: none;
}

.autocomplete-results.show { display: block; }

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-200);
    transition: background .15s;
}

.autocomplete-item:hover { background: var(--gray-50); }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item .address { font-weight: 600; color: var(--gray-700); margin-bottom: 3px; }
.autocomplete-item .meta { font-size: var(--text-xs); color: var(--gray-500); }

.autocomplete-loading {
    padding: 12px 16px;
    text-align: center;
    color: var(--gray-500);
    font-size: var(--text-sm);
}

/* --- Divider (OR) --- */
.divider {
    text-align: center;
    margin: 28px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    width: 100%;
    height: 1px;
    background: var(--gray-200);
}

.divider span {
    background: #fff;
    padding: 0 14px;
    position: relative;
    color: var(--gray-400);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: .5px;
}

/* ============================================================================
   Results page — clean / minimal
   ============================================================================ */
.report-header {
    background: var(--gray-700);
    color: #fff;
    padding: 28px 32px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    text-align: center;
}

.report-header h1 { font-size: var(--text-xl); margin-bottom: 4px; font-weight: 600; }
.report-header__address { font-size: var(--text-lg); font-weight: 600; margin-bottom: 2px; }
.report-header__meta { font-size: var(--text-sm); opacity: .7; }

.report-body {
    background: #fff;
    padding: 28px 32px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
}

/* Jump nav */
.jump-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 0 18px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

.jump-nav a {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--brand-accent);
    background: var(--gray-50);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    text-decoration: none;
    border: 1px solid var(--gray-200);
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}

.jump-nav a:hover {
    background: var(--gray-100);
    border-color: var(--brand-accent);
    text-decoration: none;
}

/* Sections */
.section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

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

.section-title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

/* Callout (constraints) */
.callout {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
}

.callout h2 {
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.callout ul { margin: 0 0 0 18px; font-size: var(--text-sm); line-height: 1.7; }

/* Summary table (top of report) */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.summary-table td { padding: 8px 0; border-bottom: 1px solid var(--gray-100); }
.summary-table tr:last-child td { border-bottom: none; }
.summary-table__label { color: var(--gray-500); width: 40%; }
.summary-table__value { color: var(--gray-800); font-weight: 600; }

/* Data table (used in detail sections) */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.data-table th {
    text-align: left;
    padding: 8px 12px 8px 0;
    color: var(--gray-500);
    font-weight: 600;
    border-bottom: 2px solid var(--gray-200);
}

.data-table td {
    padding: 8px 12px 8px 0;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.data-table tr:last-child td { border-bottom: none; }

/* Quiet / secondary text */
.quiet { color: var(--gray-500); font-weight: 400; }
.text-danger { color: var(--danger); }

/* Note paragraphs */
.note {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: 10px;
    line-height: 1.6;
}

h3 {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--gray-600);
    margin-bottom: 8px;
}

/* Collapsible sections */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
}

.section-header .toggle-icon {
    font-size: var(--text-sm);
    color: var(--gray-400);
    transition: transform .2s;
    flex-shrink: 0;
}

.section-header .toggle-icon.collapsed { transform: rotate(-90deg); }

.section-content {
    overflow: hidden;
    transition: max-height .3s ease;
}

.section-content.collapsed {
    max-height: 0 !important;
    padding-top: 0;
}

/* Summary card */
.summary-card {
    background: var(--brand-gradient);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 28px;
}

.summary-card h2 { color: #fff; margin-bottom: 18px; font-size: var(--text-xl); }

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.summary-grid__label { opacity: .8; font-size: var(--text-sm); margin-bottom: 3px; }
.summary-grid__value { font-size: var(--text-lg); font-weight: 600; }

.summary-divider {
    border-top: 1px solid rgba(255,255,255,.25);
    padding-top: 18px;
    margin-top: 18px;
}

.summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.summary-list li {
    margin-bottom: 8px;
    padding-left: 0;
    font-size: var(--text-sm);
    line-height: 1.5;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: var(--text-sm);
}

table th {
    background: var(--gray-50);
    padding: 10px 14px;
    text-align: left;
    color: var(--gray-600);
    font-weight: 600;
    border-bottom: 2px solid var(--gray-200);
}

table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

/* Process steps */
.process-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 14px;
}

.process-step__number {
    background: var(--brand-accent);
    color: #fff;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.process-step__text { flex: 1; padding-top: 3px; font-size: var(--text-sm); }

/* Checklist */
.checklist { list-style: none; }

.checklist-item {
    background: var(--gray-50);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.checklist-item__checkbox {
    width: 22px; height: 22px;
    border: 2px solid var(--gray-300);
    border-radius: 5px;
    flex-shrink: 0;
    margin-top: 2px;
}

.checklist-item__checkbox--required {
    border-color: var(--danger);
    background: var(--danger-bg);
}

.checklist-item__category {
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 3px;
}

.checklist-item__text { font-size: var(--text-sm); color: var(--gray-700); }

/* Resource link cards */
.resource-card {
    background: var(--gray-50);
    padding: 18px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--brand-accent);
    margin-bottom: 12px;
}

.resource-card__title { font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.resource-card__desc  { color: var(--gray-600); font-size: var(--text-sm); margin-bottom: 10px; }
.resource-card__link  { font-weight: 600; font-size: var(--text-sm); }

/* Constraints box */
.constraints-box {
    background: #fff8e1;
    border-left: 4px solid var(--warning);
    padding: 22px;
    border-radius: var(--radius-md);
    margin-bottom: 28px;
}

.constraints-box h2 { color: var(--warning-text); margin-bottom: 12px; font-size: var(--text-lg); }
.constraints-box p  { color: var(--warning-text); margin-bottom: 12px; font-size: var(--text-sm); }
.constraints-box ul { margin-left: 20px; color: var(--warning-text); font-size: var(--text-sm); }
.constraints-box li { margin-bottom: 8px; }

/* --- Footer / disclaimer --- */
.disclaimer {
    margin-top: 32px;
    padding: 18px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    color: var(--gray-500);
    line-height: 1.6;
    text-align: center;
}

.site-footer {
    text-align: center;
    padding: 16px;
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-top: 12px;
}

/* Lookup loading indicator */
.lookup-loading {
    display: none;
    margin-top: 14px;
    margin-bottom: 18px;
}

/* Calculated value display */
.calculated-value {
    background: var(--gray-50);
    border: 2px solid var(--brand-accent);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-top: 8px;
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.calculated-value strong { color: var(--brand-accent); }

/* --- Responsive --- */
@media (max-width: 640px) {
    .card--narrow { padding: 28px 20px; }
    .report-header { padding: 20px 16px; }
    .report-body { padding: 24px 20px; }
    .summary-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .context-bar { flex-direction: column; gap: 8px; }
    .jump-nav { gap: 6px; }
    .jump-nav a { font-size: 11px; padding: 5px 10px; }
}

/* ============================================================================
   Print styles
   ============================================================================ */
@media print {
    body { background: #fff !important; padding: 0; }
    .page-centered { background: none !important; padding: 0; min-height: auto; }

    .card {
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .btn, .btn--primary, .btn--secondary, .btn--ghost,
    .jump-nav, .section-header .toggle-icon,
    form[action="/"], .site-footer { display: none !important; }

    .report-header {
        background: var(--gray-700) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        border-radius: 0 !important;
    }

    .section { page-break-inside: avoid; }
    .section-content { max-height: none !important; }

    .callout {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .disclaimer {
        display: block !important;
        border: 1px solid #ccc;
    }

    @page { margin: 0.75in; }
}
