/**
 * Financial Architect — Score / Readiness Report Styles (fa-score.css)
 * Version: 1.3.0
 */

/* ── Wrap ──────────────────────────────────────────────────────────────────── */
.fas-wrap {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.fas-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.fas-title {
	font-size: 18px;
	font-weight: 800;
	color: var(--fa-navy);
	margin: 0 0 2px;
}

.fas-subtitle {
	font-size: 12px;
	color: var(--fa-text-muted);
	margin: 0;
}

.fas-run-btn {
	flex-shrink: 0;
}

.fas-run-error {
	background: var(--fa-danger-bg);
	color: var(--fa-danger);
	padding: 10px 14px;
	border-radius: var(--fa-radius-sm);
	font-size: 13px;
	border: 1px solid rgba(209,48,48,0.2);
}

/* ── Score Hero ───────────────────────────────────────────────────────────── */
.fas-hero {
	background: linear-gradient(135deg, var(--fa-navy) 0%, var(--fa-navy-mid) 100%);
	border-radius: var(--fa-radius-lg);
	padding: 32px 28px;
	display: flex;
	align-items: center;
	gap: 32px;
	box-shadow: var(--fa-shadow-lg);
}

.fas-score-ring-wrap {
	position: relative;
	width: 130px;
	height: 130px;
	flex-shrink: 0;
}

.fas-ring-svg {
	width: 100%;
	height: 100%;
}

.fas-ring-bg {
	fill: none;
	stroke: rgba(255,255,255,0.12);
	stroke-width: 10;
}

.fas-ring-fill {
	fill: none;
	stroke-width: 10;
	stroke-linecap: round;
	transition: stroke-dasharray 1s cubic-bezier(.4,0,.2,1);
}

/* Band-specific ring colors */
.fas-ring-fill.fas-band-blue-chip-ready  { stroke: #22c55e; }
.fas-ring-fill.fas-band-near-ready       { stroke: #60a5fa; }
.fas-ring-fill.fas-band-incubation-track { stroke: #fbbf24; }
.fas-ring-fill.fas-band-foundation-required { stroke: #fb923c; }
.fas-ring-fill.fas-band-do-not-proceed   { stroke: #f87171; }

.fas-score-number {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 36px;
	font-weight: 900;
	color: var(--fa-white);
	letter-spacing: -1px;
}

.fas-hero-meta {
	flex: 1;
}

/* Band badge */
.fas-band-badge {
	display: inline-block;
	font-size: 13px;
	font-weight: 800;
	padding: 6px 16px;
	border-radius: 30px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 10px;
}

.fas-band-blue-chip-ready    { background: #dcfce7; color: #15803d; }
.fas-band-near-ready         { background: #dbeafe; color: #1d4ed8; }
.fas-band-incubation-track   { background: #fef9c3; color: #92400e; }
.fas-band-foundation-required{ background: #ffedd5; color: #9a3412; }
.fas-band-do-not-proceed     { background: #fee2e2; color: #991b1b; }
.fas-band-unknown            { background: var(--fa-off-white); color: var(--fa-text-muted); }

.fas-band-path {
	color: rgba(255,255,255,0.72);
	font-size: 13px;
	line-height: 1.55;
	margin: 0 0 10px;
	max-width: 420px;
}

.fas-scored-at {
	font-size: 11px;
	color: rgba(255,255,255,0.4);
}

/* ── Detail Grid ──────────────────────────────────────────────────────────── */
.fas-detail-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

/* ── Panels ───────────────────────────────────────────────────────────────── */
.fas-panel {
	background: var(--fa-white);
	border: 1px solid var(--fa-border);
	border-radius: var(--fa-radius-lg);
	padding: 20px 22px;
	box-shadow: var(--fa-shadow);
}

.fas-panel-title {
	font-size: 14px;
	font-weight: 800;
	color: var(--fa-navy);
	margin: 0 0 16px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--fa-border);
}

/* ── Strengths ────────────────────────────────────────────────────────────── */
.fas-strengths-panel { border-top: 3px solid var(--fa-success); }

.fas-strength-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 8px 0;
	border-bottom: 1px solid var(--fa-border);
	font-size: 13px;
	color: var(--fa-text);
	line-height: 1.5;
}
.fas-strength-item:last-child { border-bottom: none; }

.fas-check {
	color: var(--fa-success);
	font-weight: 700;
	font-size: 15px;
	flex-shrink: 0;
	margin-top: 1px;
}

/* ── Gaps ─────────────────────────────────────────────────────────────────── */
.fas-gaps-panel { border-top: 3px solid var(--fa-warning); }

.fas-gap-item {
	padding: 12px 0;
	border-bottom: 1px solid var(--fa-border);
}
.fas-gap-item:last-child { border-bottom: none; }

.fas-gap-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 5px;
}

.fas-gap-header strong {
	font-size: 13px;
	color: var(--fa-navy);
}

.fas-gap-severity {
	font-size: 10px;
	font-weight: 800;
	padding: 2px 7px;
	border-radius: 3px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.fas-sev-critical { background: #fee2e2; color: #991b1b; }
.fas-sev-high     { background: #ffedd5; color: #9a3412; }
.fas-sev-medium   { background: #fef9c3; color: #92400e; }
.fas-sev-low      { background: var(--fa-off-white); color: var(--fa-text-muted); }

.fas-gap-detail {
	font-size: 12.5px;
	color: var(--fa-text-mid);
	margin: 0 0 6px;
	line-height: 1.5;
}

.fas-tip {
	display: flex;
	align-items: flex-start;
	gap: 7px;
	background: var(--fa-info-bg);
	border: 1px solid rgba(37,99,235,0.15);
	border-radius: var(--fa-radius-sm);
	padding: 8px 10px;
	font-size: 12px;
	color: #1e3a8a;
	line-height: 1.5;
}

.fas-tip-icon { flex-shrink: 0; font-size: 13px; }

.fas-empty-note {
	font-size: 13px;
	color: var(--fa-text-muted);
	font-style: italic;
}

/* ── Admin Panel ──────────────────────────────────────────────────────────── */
.fas-admin-panel {
	border-top: 3px solid var(--fa-gold);
	grid-column: span 2;
}

.fas-cat-bars {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.fas-cat-bar-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.fas-cat-label {
	width: 180px;
	font-size: 12.5px;
	color: var(--fa-text-mid);
	flex-shrink: 0;
}

.fas-bar-track {
	flex: 1;
	height: 10px;
	background: var(--fa-border);
	border-radius: 5px;
	overflow: hidden;
}

.fas-bar-fill {
	height: 100%;
	border-radius: 5px;
	transition: width 0.8s cubic-bezier(.4,0,.2,1);
}

.fas-bar-good { background: var(--fa-success); }
.fas-bar-mid  { background: var(--fa-warning); }
.fas-bar-low  { background: var(--fa-danger); }

.fas-cat-pct {
	width: 30px;
	text-align: right;
	font-size: 12px;
	font-weight: 700;
	color: var(--fa-navy);
}

.fas-admin-note {
	font-size: 11px;
	color: var(--fa-text-muted);
	font-style: italic;
	margin: 8px 0 0;
}

/* ── Downloads Panel ──────────────────────────────────────────────────────── */
.fas-downloads-panel {
	grid-column: span 2;
}

.fas-report-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 0;
	border-bottom: 1px solid var(--fa-border);
}
.fas-report-row:last-child { border-bottom: none; }

.fas-report-info { flex: 1; min-width: 0; }

.fas-report-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--fa-navy);
	margin-bottom: 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fas-report-meta {
	font-size: 11px;
	color: var(--fa-text-muted);
}

/* ── History ──────────────────────────────────────────────────────────────── */
.fas-history-panel {
	grid-column: span 2;
}

.fas-history-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.fas-history-table th {
	text-align: left;
	padding: 8px 12px;
	background: var(--fa-off-white);
	color: var(--fa-text-muted);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-bottom: 1px solid var(--fa-border);
}

.fas-history-table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--fa-border);
}

.fas-history-table tbody tr:last-child td { border-bottom: none; }
.fas-history-table tbody tr:hover td { background: var(--fa-off-white); }

/* ── No Score / Error ─────────────────────────────────────────────────────── */
.fas-no-score {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 60px 40px;
	text-align: center;
	background: var(--fa-white);
	border: 1px solid var(--fa-border);
	border-radius: var(--fa-radius-lg);
}

.fas-no-score-icon { font-size: 48px; margin-bottom: 16px; }
.fas-no-score h2   { font-size: 20px; font-weight: 800; color: var(--fa-navy); margin: 0 0 10px; }
.fas-no-score p    { color: var(--fa-text-mid); font-size: 14px; max-width: 380px; line-height: 1.6; margin: 0 0 22px; }

.fas-error {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 40px;
	color: var(--fa-danger);
	font-size: 14px;
}

.fas-loading { padding: 4px; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 800px) {
	.fas-detail-grid { grid-template-columns: 1fr; }
	.fas-admin-panel, .fas-history-panel { grid-column: span 1; }
	.fas-hero { flex-direction: column; align-items: flex-start; gap: 20px; }
}

/* ── Phase 14 polish ─────────────────────────────────────────────────────── */
/* Score ring animation on load */
@keyframes fas-ring-draw {
	from { stroke-dashoffset: 251.2; }
}
.fas-circle-prog { animation: fas-ring-draw 1s ease-out; }

/* Band badge entrance */
.fas-band-badge { animation: fa-fade-in 0.3s ease 0.5s both; }

/* Category bars stagger */
.fas-category-row:nth-child(1) .fas-cat-fill { animation-delay: 0.05s; }
.fas-category-row:nth-child(2) .fas-cat-fill { animation-delay: 0.1s; }
.fas-category-row:nth-child(3) .fas-cat-fill { animation-delay: 0.15s; }
.fas-category-row:nth-child(4) .fas-cat-fill { animation-delay: 0.2s; }
.fas-category-row:nth-child(5) .fas-cat-fill { animation-delay: 0.25s; }
.fas-category-row:nth-child(6) .fas-cat-fill { animation-delay: 0.3s; }
.fas-category-row:nth-child(7) .fas-cat-fill { animation-delay: 0.35s; }

@media (max-width: 700px) {
	.fas-layout { grid-template-columns: 1fr !important; }
}
