:root {
	--green-900: #325133;
	--green-800: #3f6841;
	--green-100: #e9f1e6;
	--green-050: #f7faf4;
	--gold: #d6a84f;
	--rose: #c9555d;
	--ink: #1d2a1f;
	--muted: #63715f;
	--line: #cbd9c6;
	--surface: #ffffff;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: "Segoe UI", Tahoma, sans-serif;
	color: var(--ink);
	background:
		linear-gradient(135deg, rgba(50, 81, 51, 0.13), rgba(214, 168, 79, 0.18)),
		#f4f6ed;
	min-height: 100vh;
}

.page-shell {
	width: min(980px, calc(100% - 28px));
	margin: 28px auto;
}

.form-card {
	background: var(--surface);
	border: 1px solid rgba(50, 81, 51, 0.14);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 24px 70px rgba(50, 81, 51, 0.16);
}

.header-banner {
	display: block;
	width: 100%;
	max-height: 280px;
	object-fit: cover;
	background: var(--green-900);
}

.intro-copy,
.dni-panel,
#form-section {
	width: min(760px, calc(100% - 32px));
	margin-left: auto;
	margin-right: auto;
}

.intro-copy {
	padding: 28px 0 12px;
}

.eyebrow {
	margin: 0 0 8px;
	color: var(--gold);
	font-size: 0.82rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0;
}

h1,
h2,
h3,
p {
	margin-top: 0;
}

h1 {
	margin-bottom: 8px;
	color: var(--green-900);
	font-size: clamp(1.65rem, 4vw, 2.45rem);
	line-height: 1.08;
}

.intro-copy p:last-child {
	color: var(--muted);
	margin-bottom: 0;
}

.dni-panel {
	margin-top: 14px;
	margin-bottom: 20px;
	padding: 18px;
	background: var(--green-050);
	border: 1px solid var(--line);
	border-radius: 12px;
}

label {
	display: block;
	margin-bottom: 6px;
	color: var(--green-900);
	font-weight: 800;
}

.dni-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	gap: 10px;
	align-items: end;
}

input[type="text"],
input[type="file"] {
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: #fff;
	color: var(--ink);
	font: inherit;
}

input:disabled {
	color: var(--green-900);
	background: #edf4eb;
	opacity: 1;
}

button {
	min-height: 44px;
	padding: 9px 16px;
	border: 0;
	border-radius: 8px;
	background: var(--green-900);
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font: inherit;
	font-weight: 800;
	transition: background 0.2s, transform 0.2s;
}

button:hover {
	background: var(--green-800);
}

button:active {
	transform: translateY(1px);
}

button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.secondary-btn {
	color: #fff;
	background: var(--green-800);
}

.secondary-btn:hover {
	background: var(--green-900);
}

.btn-icon {
	display: inline-flex;
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	align-items: center;
	justify-content: center;
}

.btn-icon svg {
	width: 18px;
	height: 18px;
	stroke: #fff;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	fill: none;
}

.hidden {
	display: none !important;
}

.modal {
	position: fixed;
	inset: 0;
	background: rgba(24, 37, 25, 0.48);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	padding: 18px;
}

.modal-content {
	width: min(420px, 100%);
	background: #fff;
	padding: 24px;
	border-radius: 14px;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.modal-content h2 {
	color: var(--green-900);
}

.modal-content a,
.legal-content a {
	color: var(--green-900);
	font-weight: 800;
}

.status-modal {
	border-top: 6px solid var(--gold);
}

.worker-summary {
	margin-top: 8px;
	margin-bottom: 16px;
	padding: 14px 16px;
	border-left: 5px solid var(--gold);
	background: #fbfaf3;
	border-radius: 10px;
}

.worker-summary span {
	display: block;
	color: var(--muted);
	font-size: 0.86rem;
	font-weight: 700;
}

.worker-summary strong {
	display: block;
	color: var(--green-900);
	font-size: 1.28rem;
}

.hijo-block {
	margin-bottom: 16px;
	padding: 18px;
	background: var(--green-050);
	border: 1px solid var(--line);
	border-radius: 14px;
}

.hijo-block h3 {
	margin-bottom: 16px;
	color: var(--green-900);
}

.hijo-block input {
	margin-bottom: 14px;
}

.dni-hijo-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 8px;
	align-items: start;
}

.dni-hijo-row input {
	margin-bottom: 0;
}

.buscar-dni-hijo-btn {
	background: var(--green-800);
}

.buscar-dni-hijo-btn:hover {
	background: var(--green-900);
}

.dni-hijo-status {
	margin: 6px 0 14px;
	color: var(--muted);
	font-size: 0.88rem;
}

.foto-dni-native {
	position: relative;
	display: flex;
	min-height: 86px;
	margin-top: 8px;
	margin-bottom: 8px;
	align-items: center;
	justify-content: center;
	border: 2px solid rgba(50, 81, 51, 0.25);
	border-radius: 10px;
	background: rgba(50, 81, 51, 0.08);
	cursor: pointer;
	overflow: hidden;
}

.foto-dni-native input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.foto-dni-native-content {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	color: var(--green-900);
	pointer-events: none;
	text-align: center;
}

.foto-dni-native-content .btn-icon svg {
	stroke: var(--green-900);
}

.foto-dni-native-content strong {
	text-decoration: underline;
}

.foto-dni-status {
	margin: 0;
	color: var(--muted);
	font-size: 0.92rem;
	word-break: break-word;
}

.foto-dni-preview {
	display: block;
	width: 100%;
	max-height: 240px;
	margin-top: 10px;
	object-fit: contain;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 10px;
}

.form-actions {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	padding-bottom: 28px;
}

.form-actions button[type="submit"] {
	background: var(--rose);
}

.form-actions button[type="submit"]:hover {
	background: #aa454d;
}

.success-panel {
	margin: 20px 0 32px;
	padding: 22px;
	background: var(--green-050);
	border: 1px solid var(--line);
	border-radius: 14px;
}

.success-panel h2 {
	color: var(--green-900);
}

.legal-shell {
	margin-top: 28px;
	margin-bottom: 28px;
}

.legal-card {
	overflow: hidden;
}

.legal-content {
	width: min(820px, calc(100% - 32px));
	margin: 0 auto;
	padding: 28px 0 34px;
}

.legal-content h2 {
	margin-top: 24px;
	margin-bottom: 8px;
	color: var(--green-900);
	font-size: 1.16rem;
}

.legal-content p,
.legal-content li {
	color: var(--muted);
	line-height: 1.62;
}

.updated-at {
	color: var(--gold) !important;
	font-weight: 800;
}

.legal-actions {
	margin-top: 28px;
}

.back-link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 9px 16px;
	border-radius: 8px;
	background: var(--green-900);
	color: #fff !important;
	text-decoration: none;
}

@media (max-width: 640px) {
	.page-shell {
		width: min(100% - 16px, 980px);
		margin: 8px auto;
	}

	.form-card {
		border-radius: 14px;
	}

	.header-banner {
		max-height: 180px;
	}

	.dni-row {
		grid-template-columns: 1fr;
	}

	.dni-hijo-row {
		grid-template-columns: 1fr;
	}

	.form-actions {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 6px;
	}

	.form-actions button {
		min-height: 42px;
		padding: 8px 6px;
		font-size: 0.86rem;
		gap: 5px;
	}

	.form-actions .btn-icon {
		width: 16px;
		height: 16px;
		flex-basis: 16px;
	}

	.form-actions .btn-icon svg {
		width: 16px;
		height: 16px;
	}

	.foto-dni-native-content {
		flex-wrap: wrap;
	}
}
