:root {
	--portal-bg: #f6f1e8;
	--portal-surface: #fffdfa;
	--portal-surface-strong: #ffffff;
	--portal-ink: #151515;
	--portal-muted: rgba(21, 21, 21, 0.68);
	--portal-border: #dfd6ca;
	--portal-accent: #c8102e;
	--portal-accent-dark: #9f0d24;
	--portal-dark: #1a1a1a;
	--portal-soft: #efe6da;
	--portal-tag: #f8e8eb;
	--portal-warning: #9a5a11;
	--portal-shadow: 0 24px 60px rgba(21, 21, 21, 0.08);
}

body {
	background:
		radial-gradient(circle at top left, rgba(200, 16, 46, 0.1), transparent 28%),
		linear-gradient(180deg, #fbf7f1 0%, var(--portal-bg) 100%);
	color: var(--portal-ink);
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	min-height: 100vh;
}

.portal-shell {
	max-width: 1180px;
	margin: 0 auto;
	padding: 34px 20px 72px;
}

.hero-card {
	background:
		linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 244, 236, 0.92) 100%);
	border: 1px solid rgba(21, 21, 21, 0.08);
	border-radius: 30px;
	box-shadow: var(--portal-shadow);
	display: grid;
	gap: 28px;
	grid-template-columns: 1.25fr 0.9fr;
	overflow: hidden;
	padding: 34px;
	position: relative;
}

.hero-card::after {
	background: linear-gradient(135deg, rgba(200, 16, 46, 0.12), transparent 62%);
	content: "";
	inset: 0;
	pointer-events: none;
	position: absolute;
}

.hero-copy,
.search-card {
	position: relative;
	z-index: 1;
}

.brand-lockup {
	align-items: center;
	display: flex;
	gap: 22px;
	margin-bottom: 18px;
}

.brand-logo {
	display: block;
	height: auto;
	max-width: 260px;
	width: min(100%, 260px);
}

.brand-copy {
	max-width: 420px;
}

.eyebrow,
.section-kicker {
	color: var(--portal-accent);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.18em;
	margin-bottom: 12px;
	text-transform: uppercase;
}

.hero-copy h1 {
	font-size: clamp(2rem, 3.4vw, 3.75rem);
	font-weight: 800;
	letter-spacing: -0.04em;
	line-height: 0.96;
	margin: 0;
	max-width: 12ch;
}

.lead {
	color: var(--portal-muted);
	font-size: 1.05rem;
	line-height: 1.65;
	margin: 22px 0 0;
	max-width: 42rem;
}

.hero-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 22px;
}

.hero-badge,
.invoice-tag {
	background: var(--portal-tag);
	border: 1px solid rgba(200, 16, 46, 0.12);
	border-radius: 999px;
	color: var(--portal-accent);
	font-size: 0.78rem;
	font-weight: 800;
	padding: 7px 12px;
}

.search-card {
	align-self: center;
	background: linear-gradient(180deg, #1f1f1f 0%, #151515 100%);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 24px;
	box-shadow: 0 18px 50px rgba(21, 21, 21, 0.22);
	color: white;
	padding: 26px;
}

.search-card.is-hidden {
	display: none;
}

.search-card .form-label,
.search-card .form-text {
	color: rgba(255, 255, 255, 0.74);
}

.search-card .form-control {
	background: rgba(255, 255, 255, 0.98);
	border: 0;
	border-radius: 16px 0 0 16px;
	color: var(--portal-ink);
	padding-inline: 18px;
}

.search-card .btn {
	background: linear-gradient(135deg, var(--portal-accent) 0%, var(--portal-accent-dark) 100%);
	border: 0;
	border-radius: 0 16px 16px 0;
	font-weight: 800;
	padding-inline: 22px;
}

.selected-rut-banner {
	align-items: center;
	background: rgba(255, 255, 255, 0.82);
	border: 1px solid var(--portal-border);
	border-radius: 18px;
	box-shadow: 0 12px 28px rgba(21, 21, 21, 0.06);
	display: flex;
	gap: 12px;
	margin-top: 22px;
	padding: 14px 18px;
}

.selected-rut-label {
	color: var(--portal-muted);
	font-size: 0.8rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.results-section {
	margin-top: 34px;
}

.results-header {
	align-items: end;
	display: flex;
	gap: 16px;
	justify-content: space-between;
	margin-bottom: 20px;
}

.results-header h2 {
	font-size: 1.9rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	margin: 0;
}

.totals-card {
	background: linear-gradient(135deg, #1f1f1f 0%, #111111 100%);
	border-radius: 20px;
	color: #fffaf4;
	min-width: 230px;
	padding: 18px 20px;
}

.totals-card span {
	display: block;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	opacity: 0.7;
	text-transform: uppercase;
}

.totals-card strong {
	display: block;
	font-size: 1.65rem;
	font-weight: 800;
	margin-top: 8px;
}

.invoice-list {
	display: grid;
	gap: 16px;
}

.invoice-card {
	background: rgba(255, 253, 250, 0.98);
	border: 1px solid var(--portal-border);
	border-radius: 24px;
	box-shadow: 0 16px 40px rgba(21, 21, 21, 0.05);
	display: grid;
	gap: 18px;
	grid-template-columns: auto 1fr auto;
	padding: 22px;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.invoice-card:hover {
	border-color: rgba(200, 16, 46, 0.28);
	box-shadow: 0 22px 46px rgba(21, 21, 21, 0.08);
	transform: translateY(-2px);
}

.invoice-card.selected {
	background: #fff8f8;
	border-color: rgba(200, 16, 46, 0.35);
}

.invoice-card input[type="checkbox"] {
	accent-color: var(--portal-accent);
	height: 22px;
	margin-top: 6px;
	width: 22px;
}

.invoice-title {
	font-size: 1.24rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	margin-bottom: 6px;
}

.invoice-meta {
	color: var(--portal-muted);
	display: flex;
	flex-wrap: wrap;
	font-size: 0.96rem;
	gap: 16px;
}

.invoice-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}

.invoice-amounts {
	align-items: end;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.invoice-amounts .amount {
	font-size: 1.5rem;
	font-weight: 800;
	letter-spacing: -0.03em;
}

.btn-download,
.btn-pay {
	border-radius: 999px;
	font-weight: 800;
	padding: 12px 20px;
}

.btn-download {
	background: transparent;
	border: 1px solid rgba(21, 21, 21, 0.12);
	color: var(--portal-ink);
}

.btn-download:hover {
	background: #faf3f4;
	border-color: rgba(200, 16, 46, 0.2);
}

.btn-pay {
	background: linear-gradient(135deg, var(--portal-accent) 0%, var(--portal-accent-dark) 100%);
	border: 0;
	color: white;
	min-width: 240px;
}

.btn-pay:disabled {
	opacity: 0.55;
}

.actions-bar {
	align-items: center;
	display: flex;
	gap: 16px;
	justify-content: space-between;
	margin-top: 26px;
}

.selection-meta {
	color: var(--portal-muted);
	font-weight: 800;
}

.feedback-card {
	background: rgba(255, 255, 255, 0.85);
	border: 1px solid var(--portal-border);
	border-radius: 18px;
	box-shadow: 0 10px 24px rgba(21, 21, 21, 0.04);
	padding: 16px 18px;
}

.feedback-card.warning {
	border-color: rgba(154, 90, 17, 0.28);
	color: var(--portal-warning);
}

@media (max-width: 980px) {
	.hero-card {
		grid-template-columns: 1fr;
	}

	.brand-lockup {
		align-items: start;
		flex-direction: column;
	}

	.brand-logo {
		max-width: 220px;
	}
}

@media (max-width: 900px) {
	.results-header,
	.actions-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.invoice-card {
		grid-template-columns: 1fr;
	}

	.invoice-amounts {
		align-items: start;
	}

	.totals-card,
	.btn-pay {
		width: 100%;
	}
}
