/**
 * PropertyReports.org — aligned with MyDoorsPro (Bootstrap 5, primary blue)
 */
:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --secondary: #6c757d;
    --body-bg: #ffffff;
    --section-alt: #f8f9fa;
    color-scheme: light;
    --text: #212529;
    --text-muted: #6c757d;
    --border: #dee2e6;
    --success: #198754;
    --danger: #dc3545;
    --nav-height: 72px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --radius: 10px;
}

html {
    background-color: #fff;
    color-scheme: light;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background-color: #fff !important;
    padding-top: var(--nav-height);
}

/* —— Layout —— */
.site-main {
    min-height: calc(100vh - var(--nav-height) - 120px);
    background-color: #fff;
}

body:not(.page-home) .site-main {
    background-color: var(--section-alt);
}

.page-home .site-main {
    padding-top: 0;
}

.page-home .flash-container {
    position: relative;
    z-index: 2;
    margin-top: 0.5rem;
}

.app-container {
    max-width: 960px;
    padding: 2rem 1rem 4rem;
}

.site-footer {
    background: var(--section-alt);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer-sister-link {
    font-weight: 600;
    text-decoration: none;
}

.footer-sister-link:hover {
    text-decoration: underline;
}

.navbar-brand.site-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    line-height: 1.2;
    margin-right: 1rem;
}

.site-brand-title {
    font-size: 1.25rem;
    text-decoration: none;
    color: inherit;
}

.site-brand-title:hover {
    color: inherit;
}

.site-brand-powered {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    text-transform: lowercase;
    padding-left: 1.85rem;
}

.site-brand-powered-name {
    font-weight: 600;
    color: var(--text);
    text-transform: none;
    text-decoration: none;
}

.site-brand-powered-name:hover {
    color: var(--primary);
    text-decoration: underline;
}

.navbar-brand span.text-primary {
    color: var(--primary) !important;
}

.nav-logout {
    margin: 0;
}

.navbar-nav form {
    display: inline;
    margin: 0;
}

/* —— Home hero (MyDoorsPro gradient) —— */
.page-home .hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 4rem 0 5rem;
    margin-top: calc(-1 * var(--nav-height));
    padding-top: calc(var(--nav-height) + 3rem);
}

.page-home .hero-section h1,
.page-home .hero-section p,
.page-home .hero-section .lead,
.page-home .hero-section .hero-lead,
.page-home .hero-section .hero-eyebrow,
.page-home .hero-section .hero-subcopy,
.page-home .hero-section .hero-checklist,
.page-home .hero-section .hero-checklist li {
    color: #fff;
}

.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.92;
    margin: 0;
}

.hero-lead {
    opacity: 0.95;
    max-width: 36rem;
}

.hero-badge {
    font-size: 0.95rem !important;
    font-weight: 600;
    white-space: normal;
    line-height: 1.4;
}

.hero-subcopy {
    opacity: 0.88;
}

.hero-checklist {
    opacity: 0.95;
}

.hero-metrics-panel {
    background: #fff;
    color: var(--text);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.metric-tile {
    background: var(--section-alt);
    border-radius: 8px;
    padding: 1rem;
    height: 100%;
}

.metric-tile-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.metric-tile-value {
    font-size: 1.35rem;
    font-weight: 700;
}

/* —— Trust strip —— */
.trust-item {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.75rem;
    text-align: left;
}

.trust-item i {
    font-size: 1.75rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

/* —— Features —— */
.feature-section {
    background: var(--section-alt);
}

.feature-intro {
    max-width: 32rem;
}

.feature-icon {
    font-size: 2.25rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.feature-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.pricing-card {
    border-radius: var(--radius) !important;
    transition: transform 0.2s ease;
}

.pricing-card:hover {
    transform: translateY(-3px);
}

.pricing-list li {
    padding: 0.35rem 0;
    color: var(--text);
}

.cta-section {
    background: #fff;
}

/* —— App pages (reports, auth) —— */
.hero {
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.lead,
.hero .lead {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.eyebrow {
    color: var(--primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.hero-actions {
    margin-top: 1.25rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.card h2,
.card h3 {
    margin-top: 0;
    color: var(--text);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

/* Buttons — legacy .button classes + Bootstrap */
.button,
a.button {
    display: inline-block;
    padding: 0.55rem 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text);
    background: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.5;
}

.button-primary,
a.button-primary,
.button.button-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff !important;
}

.button-primary:hover,
a.button-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff !important;
}

.button-outline,
a.button-outline {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary) !important;
}

.button-outline:hover {
    background: var(--primary);
    color: #fff !important;
}

/* Forms — always light (no dark-theme inputs) */
.app-container input[type="text"],
.app-container input[type="email"],
.app-container input[type="password"],
.app-container input[type="number"],
.app-container input[type="search"],
.app-container select,
.app-container textarea,
.report-form input[type="text"],
.app-container input[type="tel"],
.app-container input[type="url"],
.report-form input[type="number"],
.report-form select,
.report-form textarea {
    width: 100%;
    max-width: 100%;
    background-color: #fff !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    -webkit-text-fill-color: var(--text) !important;
}

.app-container input:-webkit-autofill,
.app-container input:-webkit-autofill:focus,
.report-form input:-webkit-autofill,
.report-form input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    -webkit-text-fill-color: var(--text) !important;
}

.app-container label,
.app-container legend,
.report-form label {
    font-weight: 500;
    color: var(--text);
}

.report-form .row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.report-form .column {
    flex: 1;
    min-width: 180px;
}

.report-form .column-25 {
    flex: 0 0 120px;
    min-width: 100px;
}

/* Metrics on report view */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.metric-help-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.metric-help-btn:hover,
.metric-help-btn:focus-visible {
    color: var(--primary);
    background: rgba(13, 110, 253, 0.08);
    outline: none;
}

.metric-help-modal .modal-header {
    padding-bottom: 0.5rem;
}

.metric-help-modal .modal-body {
    padding-top: 0.25rem;
}

.metric-good {
    border-color: var(--success);
    border-width: 2px;
}

.metric-bad {
    border-color: var(--danger);
    border-width: 2px;
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 0.25rem;
    color: var(--text);
}

.metrics-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem 1rem 0.5rem 0;
    width: 40%;
}

.metrics-table td {
    padding: 0.5rem 0;
    color: var(--text);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
}

.report-table th,
.report-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.report-table th {
    color: var(--text-muted);
    font-weight: 500;
}

.report-table td {
    color: var(--text);
}

.report-actions-col {
    white-space: nowrap;
    width: 1%;
}

.positive {
    color: var(--success);
}

.negative {
    color: var(--danger);
}

.prose {
    line-height: 1.7;
}

.disclaimer {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 2rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
}

code {
    background: var(--section-alt);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: #495057;
}

.app-container h1,
.app-container h2,
.app-container h3,
.hero h1 {
    color: var(--text);
}

.app-container a:not(.btn):not(.button):not(.button-primary):not(.button-outline) {
    color: var(--primary);
}

/* —— Auth pages (login / register) —— */
.page-auth .app-container {
    max-width: 720px;
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

.auth-page-header {
    margin-bottom: 1.75rem;
}

.auth-page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-page-header .lead {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.auth-plan-note {
    margin: 0;
}

.auth-card {
    max-width: 420px;
    margin: 0 auto;
    border: none;
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
}

.auth-card-register {
    max-width: 100%;
}

.auth-card-header {
    text-align: center;
    padding: 1.75rem 2rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.auth-card-header i {
    font-size: 2.25rem;
    display: block;
    margin-bottom: 0.75rem;
}

.auth-card-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.auth-form {
    padding: 1.75rem 2rem 2rem;
}

.auth-fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem 1.25rem 0.5rem;
    margin-bottom: 1.25rem;
    background: var(--section-alt);
}

.auth-fieldset-last {
    margin-bottom: 1.5rem;
}

.auth-fieldset legend {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    float: none;
    width: auto;
    padding: 0 0.35rem;
    margin-bottom: 0.75rem;
}

.auth-form .form-group,
.auth-form .input,
.auth-form .mb-3 {
    margin-bottom: 1rem;
}

.auth-form label {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.auth-form .form-text,
.auth-form .help-block {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.auth-submit {
    margin-top: 0.25rem;
    font-weight: 600;
}

.auth-links {
    margin-top: 1.25rem;
    padding: 1.25rem 2rem 2.25rem;
    border-top: 1px solid var(--border);
}

.auth-card-register .auth-links {
    margin: 0 2rem;
    padding: 1.25rem 0 2.25rem;
}

/* —— Report analysis form —— */
.page-report-form .app-container {
    max-width: 800px;
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

.report-page-header {
    margin-bottom: 1.75rem;
    text-align: center;
}

.report-page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.report-page-header .lead {
    color: var(--text-muted);
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

.report-form-card {
    position: relative;
    border: none;
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
    margin-bottom: 1rem;
}

.report-generating-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(2px);
}

.report-generating-overlay[hidden] {
    display: none !important;
}

.report-generating-inner {
    max-width: 22rem;
}

.report-generating-spinner {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

.report-generating-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.report-generating-status {
    min-height: 1.5rem;
    font-size: 0.95rem;
}

.report-form-card.is-generating .auth-submit {
    pointer-events: none;
}

.report-form-card-header {
    text-align: center;
    padding: 1.75rem 2rem 0;
    border-bottom: 1px solid var(--border);
}

.report-form-card-header i {
    font-size: 2.25rem;
    display: block;
    margin-bottom: 0.75rem;
}

.report-form-card-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.report-form-card .auth-form {
    padding: 1.75rem 2rem 1.5rem;
}

.report-fieldset legend i {
    font-size: 0.95rem;
}

.report-form-disclaimer {
    margin: 0 2rem 2rem;
    padding-top: 0.5rem;
}

.report-map-card {
    margin-bottom: 1.5rem;
}

.report-property-map {
    position: relative;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--section-alt);
}

.report-property-map iframe {
    display: block;
    width: 100%;
    height: 320px;
    border: 0;
}

.place-autocomplete-host {
    width: 100%;
}

.place-autocomplete-host gmp-place-autocomplete,
.place-autocomplete-host .property-place-autocomplete {
    width: 100%;
}

.place-autocomplete-host input {
    width: 100%;
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}

.pac-container {
    z-index: 10000;
}

.upgrade-plans .card {
    border-radius: var(--radius);
}

.upgrade-plans .display-6 {
    font-size: 2rem;
}

.auth-pro-option {
    padding: 0.75rem 1rem;
    background: var(--section-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.utilities-section {
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}

.utilities-switch {
    padding-left: 2.75rem;
}

.utilities-switch .form-check-input {
    width: 2.5em;
    height: 1.25em;
    margin-left: -2.75rem;
}

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

.landlord-utilities-fields {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    background: var(--section-alt);
    border: 1px solid var(--border);
}

/* Report view — scenario worksheet */
.page-report-view .report-scenario-card {
    margin-bottom: 1.5rem;
}

.report-scenario-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.report-scenario-fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 1.5rem;
}

.report-scenario-fieldset legend {
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.report-scenario-form.scenario-calculating {
    opacity: 0.92;
}

.report-scenario-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.rent-mode-toggle .btn {
    min-width: 7rem;
}

.scenario-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1080;
    max-width: 20rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #0f5132;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.scenario-toast-visible {
    opacity: 1;
    transform: translateY(0);
}

.scenario-toast-error {
    background: #842029;
}

.scenario-comparison-card {
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary, #0d6efd);
}

.scenario-comparison-table th {
    font-weight: 600;
    white-space: nowrap;
}

.scenario-delta-positive {
    color: #0f5132;
    font-weight: 600;
}

.scenario-delta-negative {
    color: #842029;
    font-weight: 600;
}

.scenario-delta-neutral {
    color: var(--text-muted);
}

.scenario-assumption-diff {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--section-alt);
    border-radius: 8px;
    border: 1px solid var(--border);
}

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

.scenario-assumption-list li {
    padding: 0.35rem 0;
    font-size: 0.9rem;
}

.scenario-assumption-list li + li {
    border-top: 1px dashed var(--border);
}

.report-print-scenario-note {
    font-style: italic;
}

@media print {
    .site-header,
    .site-footer,
    .no-print,
    .metric-help-btn,
    .scenario-toast,
    #metric-help-modals,
    .modal {
        display: none !important;
    }

    body {
        background: #fff;
        padding-top: 0 !important;
    }

    main.container {
        max-width: 100%;
        padding: 0;
    }

    .report-hero {
        padding-top: 0;
        margin-bottom: 1rem;
    }

    .hero-actions,
    .report-map-card {
        display: none !important;
    }

    .metrics-grid {
        break-inside: avoid;
    }

    .metric-card {
        border: 1px solid #ccc;
        box-shadow: none;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .scenario-comparison-card {
        border-left: 3px solid #333;
    }

    .report-print-disclaimer {
        margin-top: 1.5rem;
        font-size: 0.85rem;
    }

    a[href]::after {
        content: none !important;
    }
}

.nav-plan {
    font-size: 0.85rem;
}

/* Flash messages */
.message,
.alert.message {
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.message.success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.message.error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

@media (max-width: 991.98px) {
    .page-home .hero-section {
        padding-top: calc(var(--nav-height) + 2rem);
        padding-bottom: 3rem;
    }

    .hero-metrics-panel {
        margin-top: 0.5rem;
    }

    .trust-item {
        justify-content: flex-start;
    }
}
