/* LakOm Aggregate Calculator — Public Styles
   Design language: a "merit slip / admit card" motif — the artifact every
   Pakistani test-taker already recognizes — rendered in a clean, modern
   SaaS palette (deep academic navy + merit-green accent + gold highlight). */

.lakom-root {
	--lakom-primary: #12213B;
	--lakom-accent: #1F8A70;
	--lakom-gold: #E8A33D;
	--lakom-danger: #D64545;
	--lakom-surface: #FFFFFF;
	--lakom-bg: #F6F8FB;
	--lakom-line: #E1E7F0;
	--lakom-muted: #5B6B82;
	--lakom-ink: #12213B;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--lakom-ink);
	box-sizing: border-box;
}

.lakom-root *,
.lakom-root *::before,
.lakom-root *::after {
	box-sizing: inherit;
}

/* ---------- Selector card (multiple calculators) ---------- */

.lakom-selector {
	max-width: 560px;
	margin: 0 auto;
	background: var(--lakom-surface);
	border: 1px solid var(--lakom-line);
	border-radius: 18px;
	padding: 26px 24px;
	box-shadow: 0 1px 2px rgba(18, 33, 59, 0.04);
}

.lakom-selector-head {
	text-align: center;
	margin-bottom: 20px;
}

.lakom-selector-title {
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -0.01em;
	margin: 0 0 6px;
	color: var(--lakom-ink);
}

.lakom-selector-subtitle {
	color: var(--lakom-muted);
	font-size: 14px;
	margin: 0;
}

.lakom-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-bottom: 22px;
}

.lakom-tab {
	all: unset;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 16px;
	border-radius: 999px;
	border: 1.5px solid var(--lakom-line);
	color: var(--lakom-muted);
	font-weight: 700;
	font-size: 13.5px;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.lakom-tab svg {
	width: 15px;
	height: 15px;
}

.lakom-tab:hover {
	border-color: var(--lakom-accent);
	color: var(--lakom-ink);
}

.lakom-tab:focus-visible {
	outline: 2px solid var(--lakom-accent);
	outline-offset: 2px;
}

.lakom-tab.is-active {
	background: var(--lakom-primary);
	border-color: var(--lakom-primary);
	color: #fff;
}

.lakom-selector-panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 14px;
	background: var(--lakom-bg);
	border-radius: 14px;
	padding: 26px 22px;
}

.lakom-selector-panel-icon {
	width: 52px;
	height: 52px;
	border-radius: 12px;
	background: var(--lakom-primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lakom-selector-panel-icon svg {
	width: 26px;
	height: 26px;
}

.lakom-selector-panel-text h3 {
	margin: 0 0 4px;
	font-size: 19px;
	font-weight: 800;
	color: var(--lakom-ink);
}

.lakom-selector-panel-text p {
	margin: 0;
	font-size: 13.5px;
	color: var(--lakom-muted);
	line-height: 1.5;
	max-width: 380px;
}

.lakom-selector-cta {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
	background: var(--lakom-accent);
	color: #fff;
	font-weight: 700;
	font-size: 14.5px;
	padding: 11px 22px;
	border-radius: 10px;
	transition: transform 0.12s ease, background 0.15s ease;
}

.lakom-selector-cta:hover {
	background: color-mix(in srgb, var(--lakom-accent) 85%, black);
	transform: translateY(-1px);
}

.lakom-selector-cta:focus-visible {
	outline: 2px solid var(--lakom-primary);
	outline-offset: 2px;
}

@media (max-width: 480px) {
	.lakom-selector {
		padding: 22px 16px;
		border-radius: 14px;
	}

	.lakom-tab {
		padding: 8px 12px;
		font-size: 13px;
	}
}

/* ---------- Card grid (single embedded calculator) ---------- */

.lakom-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 18px;
	max-width: 980px;
	margin: 0 auto;
}

.lakom-grid-single {
	grid-template-columns: minmax(220px, 340px);
	justify-content: center;
}

.lakom-card-btn {
	all: unset;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	background: var(--lakom-surface);
	border: 1px solid var(--lakom-line);
	border-radius: 14px;
	padding: 22px 20px;
	position: relative;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
	overflow: hidden;
}

.lakom-card-btn::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 4px;
	background: linear-gradient(90deg, var(--lakom-primary), var(--lakom-accent));
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.25s ease;
}

.lakom-card-btn:hover,
.lakom-card-btn:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 12px 24px -12px rgba(18, 33, 59, 0.25);
	border-color: transparent;
}

.lakom-card-btn:focus-visible {
	outline: 2px solid var(--lakom-accent);
	outline-offset: 2px;
}

.lakom-card-btn:hover::before,
.lakom-card-btn:focus-visible::before {
	transform: scaleX(1);
}

.lakom-card-icon {
	width: 42px;
	height: 42px;
	border-radius: 10px;
	background: var(--lakom-bg);
	color: var(--lakom-primary);
	display: flex;
	align-items: center;
	justify-content: center;
}

.lakom-card-icon svg {
	width: 22px;
	height: 22px;
}

.lakom-card-name {
	font-size: 18px;
	font-weight: 700;
}

.lakom-card-desc {
	font-size: 13px;
	color: var(--lakom-muted);
	line-height: 1.4;
	margin-top: -6px;
}

.lakom-card-cta {
	margin-top: 4px;
	font-size: 13px;
	font-weight: 600;
	color: var(--lakom-accent);
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.lakom-arrow {
	transition: transform 0.18s ease;
}

.lakom-card-btn:hover .lakom-arrow {
	transform: translateX(3px);
}

/* ---------- Overlay & modal ---------- */

.lakom-overlay {
	position: fixed;
	inset: 0;
	background: rgba(12, 20, 36, 0.55);
	backdrop-filter: blur(3px);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	z-index: 100000;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.lakom-overlay.is-open {
	opacity: 1;
}

.lakom-hidden {
	display: none !important;
}

.lakom-modal {
	background: var(--lakom-surface);
	width: 100%;
	max-width: 460px;
	max-height: 90vh;
	overflow-y: auto;
	border-radius: 18px;
	position: relative;
	box-shadow: 0 30px 60px -20px rgba(12, 20, 36, 0.45);
	transform: scale(0.94) translateY(8px);
	opacity: 0;
	transition: transform 0.22s ease, opacity 0.22s ease;
}

.lakom-overlay.is-open .lakom-modal {
	transform: scale(1) translateY(0);
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.lakom-overlay,
	.lakom-modal,
	.lakom-card-btn,
	.lakom-gauge-fill {
		transition: none !important;
	}
}

.lakom-close {
	all: unset;
	position: absolute;
	top: 14px;
	right: 14px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	line-height: 1;
	color: var(--lakom-muted);
	cursor: pointer;
	z-index: 2;
}

.lakom-close:hover {
	background: var(--lakom-bg);
	color: var(--lakom-ink);
}

.lakom-modal-inner {
	padding: 28px 26px 26px;
}

.lakom-modal-head {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin-bottom: 20px;
	padding-right: 20px;
}

.lakom-modal-icon {
	width: 44px;
	height: 44px;
	flex: none;
	border-radius: 10px;
	background: var(--lakom-primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lakom-modal-icon svg {
	width: 24px;
	height: 24px;
}

.lakom-modal-head h3 {
	margin: 0 0 2px;
	font-size: 19px;
	font-weight: 800;
}

.lakom-modal-head p {
	margin: 0;
	font-size: 13px;
	color: var(--lakom-muted);
	line-height: 1.4;
}

/* ---------- Form fields ---------- */

.lakom-fields {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.lakom-field-group label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	margin-bottom: 6px;
}

.lakom-field-pair {
	display: flex;
	align-items: center;
	gap: 8px;
}

.lakom-field-pair input {
	width: 100%;
	border: 1.5px solid var(--lakom-line);
	border-radius: 9px;
	padding: 11px 13px;
	font-size: 15px;
	font-variant-numeric: tabular-nums;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	min-width: 0;
}

.lakom-field-pair input:focus {
	outline: none;
	border-color: var(--lakom-accent);
	box-shadow: 0 0 0 3px rgba(31, 138, 112, 0.15);
}

.lakom-field-total {
	flex: 0 0 90px;
	background: var(--lakom-bg);
	color: var(--lakom-muted);
	font-weight: 600;
}

.lakom-field-total:focus {
	background: var(--lakom-surface);
	color: var(--lakom-ink);
}

.lakom-field-sep {
	color: var(--lakom-muted);
	font-weight: 700;
	flex: none;
}

.lakom-field-edit-hint {
	color: var(--lakom-muted);
	opacity: 0.85;
}

.lakom-field-help {
	font-size: 12px;
	color: var(--lakom-muted);
	margin: 4px 0 0;
}

.lakom-error {
	color: var(--lakom-danger);
	background: #FBEAEA;
	border: 1px solid #f1c3c3;
	border-radius: 8px;
	padding: 9px 12px;
	font-size: 13px;
	margin: 14px 0 0;
}

.lakom-submit {
	all: unset;
	box-sizing: border-box;
	display: block;
	width: 100%;
	text-align: center;
	margin-top: 20px;
	background: var(--lakom-primary);
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	padding: 13px;
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease;
}

.lakom-submit:hover {
	background: color-mix(in srgb, var(--lakom-primary) 85%, black);
}

.lakom-submit:active {
	transform: scale(0.99);
}

.lakom-submit[disabled] {
	opacity: 0.7;
	cursor: default;
}

/* ---------- Ticket perforation (signature element) ---------- */

.lakom-perforation {
	display: none;
	align-items: center;
	gap: 6px;
	margin: 24px -26px;
	position: relative;
}

.lakom-perforation.is-visible {
	display: flex;
}

.lakom-perforation::before,
.lakom-perforation::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 20px;
	height: 20px;
	background: rgba(12, 20, 36, 0.55);
	border-radius: 50%;
	transform: translateY(-50%);
}

.lakom-perforation::before { left: -10px; }
.lakom-perforation::after { right: -10px; }

.lakom-perforation span {
	flex: 1;
	height: 1px;
	border-top: 2px dashed var(--lakom-line);
}

/* ---------- Result / merit slip ---------- */

.lakom-result {
	animation: lakom-fade-up 0.35s ease both;
}

@keyframes lakom-fade-up {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

.lakom-result-stub {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-bottom: 18px;
}

.lakom-gauge {
	position: relative;
	width: 104px;
	height: 104px;
	flex: none;
}

.lakom-gauge svg {
	width: 100%;
	height: 100%;
	display: block;
}

.lakom-gauge-track {
	fill: none;
	stroke: var(--lakom-bg);
	stroke-width: 10;
}

.lakom-gauge-fill {
	fill: none;
	stroke: var(--lakom-accent);
	stroke-width: 10;
	stroke-linecap: butt;
	stroke-dasharray: 326.73;
	stroke-dashoffset: 326.73;
	transition: stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.3s ease;
}

/* The value sits dead-center of the ring. Note: this must be
   `align-items: center` — baseline alignment on an absolutely
   stretched flex container pins the text to the top edge, which
   is exactly the "number outside the circle" bug. */
.lakom-gauge-value {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 1px;
	font-weight: 800;
	font-size: 19px;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: var(--lakom-ink);
	text-align: center;
	padding: 0 14px;
}

.lakom-gauge-value span {
	line-height: 1;
}

.lakom-gauge-value small {
	font-size: 11px;
	font-weight: 700;
	color: var(--lakom-muted);
	line-height: 1;
	align-self: flex-start;
	margin-top: 4px;
}

/* ---------- Stats panel beside the gauge ---------- */

.lakom-result-stats {
	flex: 1;
	min-width: 0;
}

.lakom-result-kicker {
	margin: 0 0 2px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--lakom-muted);
}

.lakom-remark {
	font-size: 18px;
	font-weight: 800;
	line-height: 1.25;
}

.lakom-result-score {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--lakom-ink);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	display: flex;
	align-items: baseline;
	gap: 3px;
	flex-wrap: wrap;
}

.lakom-result-score-sep {
	color: var(--lakom-muted);
	font-weight: 500;
}

.lakom-result-score-label {
	color: var(--lakom-muted);
	font-weight: 500;
	font-size: 12px;
	margin-left: 2px;
}

.lakom-next-tier {
	margin: 8px 0 0;
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--lakom-muted);
	background: var(--lakom-bg);
	border-left: 3px solid var(--lakom-gold);
	border-radius: 0 8px 8px 0;
	padding: 7px 10px;
}

.lakom-next-tier strong {
	color: var(--lakom-ink);
}

.lakom-result-note {
	margin: 14px 0 0;
	font-size: 11.5px;
	line-height: 1.5;
	color: var(--lakom-muted);
	text-align: center;
}

.lakom-breakdown {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--lakom-line);
}

.lakom-breakdown li {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 10px 0;
	border-bottom: 1px solid var(--lakom-line);
	font-size: 13px;
}

.lakom-breakdown .lakom-bd-label {
	color: var(--lakom-ink);
	font-weight: 600;
}

.lakom-breakdown .lakom-bd-detail {
	color: var(--lakom-muted);
	font-size: 12px;
	display: block;
}

.lakom-breakdown .lakom-bd-value {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--lakom-accent);
}

.lakom-recalculate {
	all: unset;
	box-sizing: border-box;
	display: block;
	width: 100%;
	text-align: center;
	margin-top: 18px;
	border: 1.5px solid var(--lakom-line);
	color: var(--lakom-ink);
	font-weight: 700;
	font-size: 14px;
	padding: 11px;
	border-radius: 10px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.lakom-recalculate:hover {
	border-color: var(--lakom-accent);
	background: var(--lakom-bg);
}

.lakom-empty {
	color: var(--lakom-muted);
	text-align: center;
}

@media (max-width: 480px) {
	.lakom-modal-inner {
		padding: 24px 18px 20px;
	}

	.lakom-perforation {
		margin: 22px -18px;
	}

	/* Keep the gauge and stats side by side on phones — just shrink
	   the gauge slightly so the stats panel has comfortable width. */
	.lakom-result-stub {
		gap: 14px;
	}

	.lakom-gauge {
		width: 92px;
		height: 92px;
	}

	.lakom-gauge-value {
		font-size: 17px;
	}
}
