/**
 * Financial Architect — Print Stylesheet (fa-print.css)
 *
 * Loaded on report pages to produce clean, professional
 * PDF/print output from the browser's print function.
 *
 * Phase 14: UI Polish & QA.
 */

@media print {
	/* ── Page setup ──────────────────────────────────────────────────────── */
	@page {
		margin: 22mm 20mm 22mm 20mm;
		size: letter portrait;
	}

	* { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

	body {
		font-family: Georgia, 'Times New Roman', serif;
		font-size: 11pt;
		line-height: 1.65;
		color: #1e2536;
		background: #fff;
	}

	/* ── Hide non-print elements ─────────────────────────────────────────── */
	.fa-header, .fa-sidebar, .fa-agent-panel, .fa-progress-rail,
	.fa-nav, .fa-btn, .fa-toast-host, .fa-mobile-nav-toggle,
	.no-print, [data-no-print] { display: none !important; }

	/* ── Report header ───────────────────────────────────────────────────── */
	.fa-report-header {
		display: flex !important;
		justify-content: space-between;
		align-items: flex-start;
		border-bottom: 3px solid #1a2744;
		padding-bottom: 14px;
		margin-bottom: 24px;
	}

	.fa-report-logo {
		font-size: 18pt;
		font-weight: 900;
		font-family: Arial, sans-serif;
		color: #1a2744;
	}
	.fa-report-logo span { color: #c9a227; }

	.fa-report-title-block { text-align: right; }
	.fa-report-title {
		font-size: 14pt;
		font-weight: 700;
		color: #1a2744;
		display: block;
	}
	.fa-report-subtitle {
		font-size: 10pt;
		color: #6b7280;
		display: block;
	}

	/* ── Watermark ───────────────────────────────────────────────────────── */
	.fa-report-watermark {
		text-align: center;
		font-size: 8pt;
		font-family: Arial, sans-serif;
		font-weight: 700;
		color: #991b1b;
		text-transform: uppercase;
		letter-spacing: 1.5px;
		padding: 6px 12px;
		border: 1px solid #fca5a5;
		background: #fef2f2;
		margin-bottom: 20px;
		border-radius: 4px;
	}

	/* ── Score hero ──────────────────────────────────────────────────────── */
	.fa-score-hero-print {
		display: grid !important;
		grid-template-columns: auto 1fr;
		gap: 20px;
		align-items: center;
		background: #1a2744 !important;
		color: #fff !important;
		padding: 20px 24px;
		border-radius: 8px;
		margin-bottom: 24px;
		page-break-inside: avoid;
	}

	.fa-score-big-print {
		font-size: 56pt;
		font-weight: 900;
		color: #c9a227 !important;
		line-height: 1;
		font-family: Arial, sans-serif;
	}

	/* ── Report sections ─────────────────────────────────────────────────── */
	.fa-report-section {
		margin-bottom: 20px;
		page-break-inside: avoid;
	}

	.fa-report-section h2 {
		font-size: 12pt;
		font-weight: 700;
		font-family: Arial, sans-serif;
		color: #1a2744;
		border-bottom: 1px solid #dde3ef;
		padding-bottom: 6px;
		margin-bottom: 10px;
	}

	.fa-report-section h3 {
		font-size: 10.5pt;
		font-weight: 700;
		font-family: Arial, sans-serif;
		color: #1a2744;
		margin-bottom: 6px;
	}

	/* ── Tables in reports ───────────────────────────────────────────────── */
	.fa-report-table {
		width: 100%;
		border-collapse: collapse;
		font-size: 10pt;
		margin-bottom: 14px;
	}
	.fa-report-table th {
		background: #1a2744 !important;
		color: #fff !important;
		padding: 7px 10px;
		text-align: left;
		font-weight: 700;
		font-size: 9pt;
	}
	.fa-report-table td {
		padding: 6px 10px;
		border-bottom: 1px solid #dde3ef;
		vertical-align: top;
	}
	.fa-report-table tr:last-child td { border-bottom: none; }

	/* Alternating rows */
	.fa-report-table tr:nth-child(even) td { background: #f8f9fb !important; }

	/* ── Category bars (BDR report) ─────────────────────────────────────── */
	.fa-cat-bar-print {
		display: flex !important;
		gap: 6px;
		align-items: center;
		margin-bottom: 6px;
	}
	.fa-cat-bar-label { width: 140px; font-size: 9.5pt; }
	.fa-cat-bar-track {
		flex: 1;
		height: 8px;
		background: #f0f2f8;
		border-radius: 4px;
		overflow: hidden;
	}
	.fa-cat-bar-fill {
		height: 100%;
		background: #1a2744 !important;
		border-radius: 4px;
	}
	.fa-cat-bar-score {
		width: 36px;
		text-align: right;
		font-weight: 700;
		font-size: 9.5pt;
		color: #1a2744;
	}

	/* ── Strength/gap bullets ────────────────────────────────────────────── */
	.fa-strength-list, .fa-gap-list { list-style: none; padding: 0; margin: 0 0 10px; }
	.fa-strength-list li::before { content: '✓ '; color: #22a06b; font-weight: 700; }
	.fa-gap-list     li::before { content: '⚠ '; color: #d97706; font-weight: 700; }
	.fa-strength-list li, .fa-gap-list li { font-size: 10pt; margin-bottom: 4px; }

	/* ── Disclaimer footer ───────────────────────────────────────────────── */
	.fa-report-disclaimer {
		font-size: 8pt;
		color: #6b7280;
		border-top: 1px solid #dde3ef;
		padding-top: 10px;
		margin-top: 24px;
		line-height: 1.5;
	}

	/* ── Page footer ─────────────────────────────────────────────────────── */
	.fa-report-footer {
		text-align: center;
		font-size: 8pt;
		color: #9ca3af;
		font-family: Arial, sans-serif;
	}

	/* ── Page breaks ─────────────────────────────────────────────────────── */
	.fa-page-break      { page-break-before: always; }
	.fa-no-break        { page-break-inside: avoid; }
	.fa-break-after     { page-break-after: always; }
}

/* ── Screen: report preview styles ──────────────────────────────────────── */
@media screen {
	.fa-report-preview {
		max-width: 860px;
		margin: 0 auto;
		padding: 40px;
		background: #fff;
		border: 1px solid var(--fa-border);
		border-radius: var(--fa-radius-lg);
		box-shadow: var(--fa-shadow-lg);
	}

	.fa-report-print-btn {
		position: fixed;
		bottom: 24px;
		right: 80px;
		z-index: 100;
	}
}
