/* Factorization Calculator — Teal & Navy theme */

.fzc-widget {
	--fzc-navy-950: #0a1120;
	--fzc-navy-900: #0f172a;
	--fzc-navy-800: #16223b;
	--fzc-navy-700: #1e2c4a;
	--fzc-teal-300: #5eead4;
	--fzc-teal-400: #2dd4bf;
	--fzc-teal-600: #0d9488;
	--fzc-text-soft: #94a3b8;
	--fzc-text-faint: #4c5c7a;

	max-width: 560px;
	margin: 2rem auto;
	padding: 2rem 1.75rem 1.75rem;
	border-radius: 22px;
	background: linear-gradient(160deg, var(--fzc-navy-900) 0%, var(--fzc-navy-950) 100%);
	box-shadow:
		0 20px 45px -15px rgba(10, 17, 32, 0.55),
		0 0 0 1px rgba(45, 212, 191, 0.12),
		inset 0 1px 0 rgba(255, 255, 255, 0.04);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
}

.fzc-widget *,
.fzc-widget *::before,
.fzc-widget *::after {
	box-sizing: border-box;
}

.fzc-widget::before {
	content: "";
	position: absolute;
	top: -60%;
	left: 50%;
	width: 140%;
	height: 140%;
	transform: translateX(-50%);
	background: radial-gradient(circle, rgba(45, 212, 191, 0.14) 0%, rgba(45, 212, 191, 0) 60%);
	pointer-events: none;
}

.fzc-header {
	text-align: center;
	margin-bottom: 1.4rem;
	position: relative;
}

.fzc-eyebrow {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.22em;
	color: var(--fzc-teal-300);
	text-transform: uppercase;
}

.fzc-title {
	margin: 0.35rem 0 0;
	font-size: 1.5rem;
	font-weight: 800;
	color: #f1f5f9;
	letter-spacing: -0.01em;
}

.fzc-field {
	margin-bottom: 0.9rem;
}

.fzc-label {
	display: block;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--fzc-teal-300);
	margin-bottom: 0.4rem;
}

.fzc-input {
	width: 100%;
	padding: 0.75rem 0.9rem;
	border-radius: 12px;
	border: 1px solid rgba(94, 234, 212, 0.18);
	background: var(--fzc-navy-800);
	color: #f1f5f9;
	font-family: inherit;
	font-size: 1.05rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fzc-input::placeholder {
	color: #506080;
	font-weight: 500;
}

.fzc-input:focus {
	border-color: var(--fzc-teal-400);
	box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

.fzc-samples {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 1rem;
}

.fzc-chip {
	padding: 0.4rem 0.75rem;
	border-radius: 999px;
	border: 1px solid rgba(94, 234, 212, 0.18);
	background: var(--fzc-navy-800);
	color: var(--fzc-teal-300);
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.fzc-chip:hover {
	background: var(--fzc-navy-700);
	border-color: rgba(94, 234, 212, 0.4);
}

.fzc-error {
	margin-bottom: 1rem;
	padding: 0.7rem 0.9rem;
	border-radius: 10px;
	background: rgba(220, 38, 38, 0.12);
	border: 1px solid rgba(248, 113, 113, 0.3);
	color: #fca5a5;
	font-size: 0.85rem;
	line-height: 1.5;
}

.fzc-note-box {
	margin-bottom: 1rem;
	padding: 0.7rem 0.9rem;
	border-radius: 10px;
	background: rgba(45, 212, 191, 0.08);
	border: 1px solid rgba(94, 234, 212, 0.2);
	color: var(--fzc-teal-300);
	font-size: 0.85rem;
	line-height: 1.5;
}

.fzc-result {
	padding: 1.1rem;
	border-radius: 14px;
	background: rgba(30, 44, 74, 0.45);
	border: 1px solid rgba(94, 234, 212, 0.15);
	text-align: center;
	margin-bottom: 1.1rem;
}

.fzc-result-label {
	display: block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--fzc-text-faint);
	margin-bottom: 0.35rem;
}

.fzc-result-value {
	font-size: 1.4rem;
	font-weight: 800;
	color: var(--fzc-teal-300);
	word-break: break-word;
	text-shadow: 0 0 18px rgba(45, 212, 191, 0.2);
}

.fzc-section-title {
	display: block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--fzc-teal-300);
	margin-bottom: 0.65rem;
	text-align: center;
}

.fzc-tree-wrap {
	margin-bottom: 1.25rem;
	padding: 1rem 0.5rem 0.5rem;
	border-radius: 14px;
	background: rgba(15, 23, 42, 0.55);
	border: 1px solid rgba(94, 234, 212, 0.12);
	overflow-x: auto;
}

/* ---------- Factor tree (pure-CSS org chart pattern) ---------- */

.fzc-tree,
.fzc-tree ul {
	padding-top: 20px;
	position: relative;
	display: flex;
	justify-content: center;
	width: max-content;
	min-width: 100%;
	margin: 0 auto;
}

.fzc-tree ul {
	padding-top: 20px;
}

.fzc-tree li {
	list-style-type: none;
	position: relative;
	padding: 20px 10px 0 10px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.fzc-tree li::before,
.fzc-tree li::after {
	content: "";
	position: absolute;
	top: 0;
	right: 50%;
	border-top: 1.5px solid rgba(94, 234, 212, 0.45);
	width: 50%;
	height: 20px;
}

.fzc-tree li::after {
	right: auto;
	left: 50%;
	border-left: 1.5px solid rgba(94, 234, 212, 0.45);
}

.fzc-tree li:only-child::before,
.fzc-tree li:only-child::after {
	display: none;
}

.fzc-tree li:only-child {
	padding-top: 0;
}

.fzc-tree li:first-child::before,
.fzc-tree li:last-child::after {
	border: 0 none;
}

.fzc-tree li:last-child::before {
	border-right: 1.5px solid rgba(94, 234, 212, 0.45);
	border-radius: 0 6px 0 0;
}

.fzc-tree li:first-child::after {
	border-radius: 6px 0 0 0;
}

.fzc-tree > li {
	padding-top: 0;
}

.fzc-tree ul::before {
	content: "";
	position: absolute;
	top: 0;
	left: 50%;
	border-left: 1.5px solid rgba(94, 234, 212, 0.45);
	width: 0;
	height: 20px;
}

.fzc-node {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	padding: 0.4rem 0.6rem;
	border-radius: 10px;
	border: 1px solid rgba(94, 234, 212, 0.25);
	background: var(--fzc-navy-800);
	color: #e2e8f0;
	font-size: 0.85rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.fzc-node.is-prime {
	background: linear-gradient(135deg, var(--fzc-teal-400), var(--fzc-teal-600));
	color: var(--fzc-navy-950);
	border-color: transparent;
}

/* ---------- Stats ---------- */

.fzc-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.6rem;
	margin-bottom: 1.1rem;
}

.fzc-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.3rem;
	padding: 0.8rem 0.5rem;
	border-radius: 12px;
	background: rgba(30, 44, 74, 0.45);
	border: 1px solid rgba(94, 234, 212, 0.15);
	text-align: center;
}

.fzc-stat-label {
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--fzc-text-faint);
}

.fzc-stat-value {
	font-size: 1.05rem;
	font-weight: 800;
	color: var(--fzc-teal-300);
	font-variant-numeric: tabular-nums;
	word-break: break-word;
}

/* ---------- Divisors ---------- */

.fzc-divisors-wrap {
	padding: 1rem;
	border-radius: 14px;
	background: rgba(15, 23, 42, 0.55);
	border: 1px solid rgba(94, 234, 212, 0.12);
}

.fzc-divisors {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	max-height: 220px;
	overflow-y: auto;
}

.fzc-divisor {
	padding: 0.35rem 0.6rem;
	border-radius: 8px;
	background: rgba(30, 44, 74, 0.55);
	border: 1px solid rgba(94, 234, 212, 0.14);
	color: #cbd5e1;
	font-size: 0.82rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.fzc-divisor-more {
	padding: 0.35rem 0.6rem;
	font-size: 0.8rem;
	color: var(--fzc-text-faint);
	font-style: italic;
}
