/**
 * CrownateStudio Property Intelligence — Application 03: Deal Checker
 * Styling (css/deal-checker.css)
 *
 * Luxury obsidian & deep navy design system
 * Primary: #070b14, #0d1527, Accent Gold: #c5a059, Warm Amber: #d97706
 */

:root {
    --deal-bg-page: #070b14;
    --deal-bg-surface: #0d1527;
    --deal-bg-elevated: #131f38;
    --deal-bg-glass: rgba(13, 21, 39, 0.75);
    --deal-border: rgba(197, 160, 89, 0.2);
    --deal-border-light: rgba(255, 255, 255, 0.08);
    --deal-border-strong: #c5a059;
    --deal-gold: #c5a059;
    --deal-gold-glow: rgba(197, 160, 89, 0.35);
    --deal-amber: #d97706;
    --deal-text-main: #f8fafc;
    --deal-text-secondary: #94a3b8;
    --deal-text-muted: #64748b;
    --deal-danger: #ef4444;
    --deal-warning: #f59e0b;
    --deal-success: #10b981;
    --deal-blue: #3b82f6;
    --deal-radius: 12px;
}

body.deal-checker-page {
    background-color: var(--deal-bg-page);
    color: var(--deal-text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Container */
.deal-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.25rem 5rem 1.25rem;
}

/* Header & Breadcrumb */
.deal-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0 2rem 0;
    border-bottom: 1px solid var(--deal-border-light);
    margin-bottom: 2rem;
}

.deal-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--deal-text-main);
}

.deal-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #c5a059, #8c6d32);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #070b14;
    font-size: 1.1rem;
    box-shadow: 0 0 15px var(--deal-gold-glow);
}

.deal-brand-title {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.deal-brand-badge {
    font-size: 0.65rem;
    background: rgba(197, 160, 89, 0.15);
    color: var(--deal-gold);
    border: 1px solid var(--deal-border);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.deal-top-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.deal-nav-link {
    color: var(--deal-text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.15s;
}

.deal-nav-link:hover {
    color: var(--deal-gold);
}

/* Hero Section */
.deal-hero {
    text-align: center;
    max-width: 820px;
    margin: 0 auto 3rem auto;
}

.deal-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(197, 160, 89, 0.1);
    border: 1px solid var(--deal-border);
    padding: 0.35rem 1rem;
    border-radius: 50px;
    color: var(--deal-gold);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 1.25rem;
}

.deal-hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 1rem 0;
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.deal-hero p.deal-hero-sub {
    font-size: 1.15rem;
    color: var(--deal-text-secondary);
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.deal-hero p.deal-hero-tertiary {
    font-size: 0.95rem;
    color: var(--deal-text-muted);
    margin: 0 0 2rem 0;
}

/* Preload Bar (Ecosystem Bridge) */
.deal-ecosystem-bridge {
    background: var(--deal-bg-surface);
    border: 1px solid var(--deal-border-light);
    border-radius: var(--deal-radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.bridge-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.bridge-icon {
    font-size: 1.5rem;
}

.bridge-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.bridge-sub {
    font-size: 0.8rem;
    color: var(--deal-text-muted);
}

.bridge-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-bridge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--deal-border-light);
    color: var(--deal-text-secondary);
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-bridge:hover {
    background: rgba(197, 160, 89, 0.15);
    border-color: var(--deal-border);
    color: var(--deal-gold);
}

/* Multi-Step Workstation Card */
.deal-workstation {
    background: var(--deal-bg-surface);
    border: 1px solid var(--deal-border-light);
    border-radius: var(--deal-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    margin-bottom: 3rem;
}

.deal-steps-nav {
    display: flex;
    border-bottom: 1px solid var(--deal-border-light);
    background: rgba(7, 11, 20, 0.5);
    overflow-x: auto;
}

.deal-step-tab {
    flex: 1;
    min-width: 140px;
    padding: 1rem 0.75rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--deal-text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.deal-step-tab.active {
    color: var(--deal-gold);
    border-bottom-color: var(--deal-gold);
    background: rgba(197, 160, 89, 0.05);
}

.deal-step-tab.completed {
    color: #ffffff;
}

.deal-form-body {
    padding: 2.5rem 2rem;
}

.deal-step-pane {
    display: none;
}

.deal-step-pane.active {
    display: block;
    animation: fadeIn 0.25s ease-out;
}

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

.deal-section-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #ffffff;
}

.deal-section-desc {
    color: var(--deal-text-secondary);
    font-size: 0.9rem;
    margin: 0 0 1.75rem 0;
}

/* Form Controls */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

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

.form-label {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--deal-text-secondary);
    display: flex;
    justify-content: space-between;
}

.form-input, .form-select, .form-textarea {
    background: #070b14;
    border: 1px solid var(--deal-border-light);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #ffffff;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.15s;
    box-sizing: border-box;
    width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--deal-gold);
    box-shadow: 0 0 10px var(--deal-gold-glow);
}

.price-input-wrapper {
    position: relative;
    display: flex;
}

.price-currency-select {
    width: 100px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.price-amount-input {
    flex: 1;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* Radio Cards (Property Type, Condition, etc.) */
.radio-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.radio-card {
    background: #070b14;
    border: 1px solid var(--deal-border-light);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    user-select: none;
}

.radio-card:hover {
    border-color: rgba(197, 160, 89, 0.4);
    background: rgba(197, 160, 89, 0.03);
}

.radio-card.selected {
    border-color: var(--deal-gold);
    background: rgba(197, 160, 89, 0.1);
    box-shadow: 0 0 12px var(--deal-gold-glow);
}

.radio-card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.radio-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
}

.radio-card-sub {
    font-size: 0.725rem;
    color: var(--deal-text-muted);
    margin-top: 0.25rem;
}

/* Workstation Action Footer */
.deal-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--deal-border-light);
    margin-top: 2rem;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--deal-border-light);
    color: var(--deal-text-secondary);
    padding: 0.65rem 1.25rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-secondary:hover {
    border-color: #ffffff;
    color: #ffffff;
}

.btn-primary {
    background: linear-gradient(135deg, #c5a059, #a38038);
    border: none;
    color: #070b14;
    padding: 0.75rem 1.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px var(--deal-gold-glow);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(197, 160, 89, 0.5);
}

/* ========================================================
   RESULTS WORKSTATION
   ======================================================== */
.deal-results-container {
    display: none;
}

.deal-results-container.visible {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Prominent Statutory Disclaimer Banner */
.deal-disclaimer-banner {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 4px solid var(--deal-warning);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.deal-disclaimer-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
    font-weight: 800;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.deal-disclaimer-text {
    font-size: 0.825rem;
    color: #fde68a;
    line-height: 1.5;
    margin: 0;
}

/* Master Deal Score Banner */
.deal-score-banner {
    background: linear-gradient(135deg, #0d1527 0%, #152240 100%);
    border: 1px solid var(--deal-border);
    border-radius: var(--deal-radius);
    padding: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}

.score-banner-left {
    flex: 1;
    min-width: 300px;
}

.deal-ref-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--deal-gold);
    background: rgba(197, 160, 89, 0.1);
    border: 1px solid var(--deal-border);
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 0.85rem;
}

.deal-tier-title {
    font-size: 1.85rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    color: #ffffff;
}

.deal-tier-headline {
    color: var(--deal-text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.score-banner-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 170px;
}

.deal-gauge-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 6px solid var(--deal-border-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #070b14;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
}

.deal-gauge-num {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
}

.deal-gauge-max {
    font-size: 0.75rem;
    color: var(--deal-text-muted);
    font-weight: 700;
}

/* Indicative Range & Price Position Cards */
.deal-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.metric-card {
    background: var(--deal-bg-surface);
    border: 1px solid var(--deal-border-light);
    border-radius: var(--deal-radius);
    padding: 1.75rem;
}

.metric-card-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--deal-text-muted);
    margin-bottom: 0.65rem;
}

.metric-card-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.metric-card-sub {
    font-size: 0.85rem;
    color: var(--deal-text-secondary);
}

/* Price Position Meter */
.position-meter {
    display: flex;
    height: 8px;
    background: #070b14;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0 0.5rem 0;
}

.meter-segment {
    flex: 1;
    opacity: 0.3;
}

.meter-segment.active {
    opacity: 1;
    box-shadow: 0 0 8px currentColor;
}

.meter-below { background: var(--deal-blue); }
.meter-within { background: var(--deal-success); }
.meter-above { background: var(--deal-danger); }

/* Score Breakdown Bars */
.breakdown-section {
    background: var(--deal-bg-surface);
    border: 1px solid var(--deal-border-light);
    border-radius: var(--deal-radius);
    padding: 1.75rem;
    margin-bottom: 2.5rem;
}

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

.breakdown-item-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.825rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.breakdown-bar-track {
    height: 6px;
    background: #070b14;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.breakdown-bar-fill {
    height: 100%;
    background: var(--deal-gold);
    border-radius: 3px;
}

.breakdown-item-desc {
    font-size: 0.75rem;
    color: var(--deal-text-muted);
}

/* Comparables Table */
.comparables-section {
    background: var(--deal-bg-surface);
    border: 1px solid var(--deal-border-light);
    border-radius: var(--deal-radius);
    padding: 1.75rem;
    margin-bottom: 2.5rem;
    overflow-x: auto;
}

table.deal-comp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 1rem;
}

table.deal-comp-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: #070b14;
    color: var(--deal-text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--deal-border-light);
}

table.deal-comp-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--deal-border-light);
    color: var(--deal-text-secondary);
}

table.deal-comp-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.provenance-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.prov-verified {
    background: rgba(16, 185, 129, 0.15);
    color: var(--deal-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.prov-evidence {
    background: rgba(59, 130, 246, 0.15);
    color: var(--deal-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.prov-user {
    background: rgba(245, 158, 11, 0.15);
    color: var(--deal-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Negotiation & Missing Info Cards */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.deal-card-panel {
    background: var(--deal-bg-surface);
    border: 1px solid var(--deal-border-light);
    border-radius: var(--deal-radius);
    padding: 1.75rem;
}

.deal-card-item {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--deal-border-light);
}

.deal-card-item:last-child {
    border-bottom: none;
}

.deal-card-item-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.deal-card-item-body {
    font-size: 0.825rem;
    color: var(--deal-text-secondary);
    line-height: 1.5;
}

/* Red Flags Matrix */
.red-flags-section {
    background: var(--deal-bg-surface);
    border: 1px solid var(--deal-border-light);
    border-radius: var(--deal-radius);
    padding: 1.75rem;
    margin-bottom: 2.5rem;
}

.flag-card {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid transparent;
}

.flag-card.critical {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
}

.flag-card.attention {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.3);
}

.flag-card.info {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
}

.flag-card.pass {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
}

.flag-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.flag-card.critical .flag-title { color: #f87171; }
.flag-card.attention .flag-title { color: #fbbf24; }
.flag-card.info .flag-title { color: #60a5fa; }
.flag-card.pass .flag-title { color: #34d399; }

.flag-desc {
    font-size: 0.825rem;
    color: var(--deal-text-secondary);
    margin: 0;
}

/* Next Steps & Conversion CTAs */
.next-steps-banner {
    background: linear-gradient(135deg, #131f38, #070b14);
    border: 1px solid var(--deal-border);
    border-radius: var(--deal-radius);
    padding: 2.25rem;
    margin-bottom: 2.5rem;
    text-align: center;
}

.next-steps-banner h2 {
    font-size: 1.65rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    color: #ffffff;
}

.next-steps-banner p {
    color: var(--deal-text-secondary);
    font-size: 0.95rem;
    max-width: 650px;
    margin: 0 auto 1.75rem auto;
}

.conversion-cta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.btn-cta-card {
    background: var(--deal-bg-surface);
    border: 1px solid var(--deal-border-light);
    border-radius: 8px;
    padding: 1.25rem 1rem;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.btn-cta-card:hover {
    border-color: var(--deal-gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--deal-gold-glow);
}

.btn-cta-card span.cta-sub {
    font-size: 0.725rem;
    font-weight: 500;
    color: var(--deal-text-muted);
}

/* Action Bar (Download PDF, Share, Save) */
.deal-actions-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

/* Share Modal */
.deal-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.25rem;
}

.deal-modal-backdrop.open {
    display: flex;
}

.deal-modal-card {
    background: var(--deal-bg-surface);
    border: 1px solid var(--deal-border);
    border-radius: var(--deal-radius);
    max-width: 480px;
    width: 100%;
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
    position: relative;
}

.deal-modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    color: var(--deal-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
}

.deal-modal-close:hover {
    color: #ffffff;
}

.share-preview-card {
    background: #070b14;
    border: 1px solid var(--deal-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}

.share-preview-brand {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--deal-gold);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.share-preview-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.share-preview-stat {
    font-size: 0.85rem;
    color: var(--deal-text-secondary);
    margin: 0.25rem 0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .deal-hero h1 { font-size: 2rem; }
    .form-grid-2, .form-grid-3, .deal-metrics-grid, .breakdown-grid, .two-col-grid {
        grid-template-columns: 1fr;
    }
    .deal-score-banner {
        flex-direction: column;
        align-items: flex-start;
    }
    .score-banner-right {
        align-self: center;
    }
    .deal-top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
