/* Landing / login App COEDPI — fiel al prototipo V1 */
:root {
	--gold: #e5bd18;
	--olive: #907917;
	--gold-soft: #fff8da;
	--ivory: #fbfaf7;
	--cream: #f5f1e9;
	--line: #e8e2d9;
	--white: #fff;
	--green: #657b2b;
	--muted: #7a7364;
	--ink: #211c08;
	--shadow: 0 12px 34px #4d3d1912;
	--small-shadow: 0 4px 15px #4d3d190f;
}

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

html,
body.coedpi-app-landing {
	margin: 0;
	padding: 0;
	min-height: 100%;
	background: var(--ivory);
	color: var(--ink);
	font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	-webkit-font-smoothing: antialiased;
}

body.coedpi-app-landing a {
	color: inherit;
	text-decoration: none;
}

.login-page {
	background: linear-gradient(120deg, #fff 0 54%, #faf7ef 54%);
	min-height: 100vh;
}

.public-header {
	border-bottom: 1px solid #efe8d8;
	justify-content: space-between;
	align-items: center;
	height: 70px;
	padding: 0 5vw;
	display: flex;
}

.public-header > span {
	color: var(--olive);
	letter-spacing: 0.11em;
	font-size: 10px;
	font-weight: 800;
}

.brand {
	align-items: center;
	gap: 11px;
	display: flex;
}

.brand img {
	width: 38px;
	height: 38px;
	object-fit: contain;
}

.brand strong {
	color: var(--olive);
	letter-spacing: 0.1em;
	font-size: 14px;
}

.login-layout {
	grid-template-columns: 1.12fr 0.88fr;
	grid-template-areas:
		"intro card"
		"features card";
	align-items: center;
	gap: 8vw;
	row-gap: 0;
	max-width: 1280px;
	min-height: calc(100vh - 70px);
	margin: auto;
	padding: 70px 5vw;
	display: grid;
}

.login-intro {
	grid-area: intro;
	align-self: end;
}

.login-card {
	grid-area: card;
	align-self: center;
}

.feature-row {
	grid-area: features;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-top: 42px;
	align-self: start;
	display: grid;
}

.login-intro .eyebrow {
	color: var(--olive);
	letter-spacing: 0.12em;
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 850;
}

.login-intro h1 {
	margin: 0 0 24px;
	font-size: clamp(48px, 5.5vw, 76px);
	line-height: 1.02;
	font-weight: 850;
}

.login-intro > p:not(.eyebrow) {
	color: var(--muted);
	max-width: 610px;
	margin: 0;
	font-size: 18px;
	line-height: 1.45;
}

.feature-row span {
	color: var(--muted);
	border-top: 1px solid #dfd3b5;
	padding-top: 13px;
	font-size: 11px;
	display: grid;
	gap: 6px;
}

.feature-row b {
	color: var(--gold);
	font-size: 19px;
}

.card.login-card,
.login-card {
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: 18px;
	width: 100%;
	max-width: 460px;
	margin-left: auto;
	padding: 36px;
	box-shadow: 0 24px 70px #604d1d1c;
}

.login-card .badge {
	color: var(--olive);
	white-space: nowrap;
	background: var(--gold-soft);
	border-radius: 999px;
	align-items: center;
	min-height: 24px;
	padding: 4px 9px;
	font-size: 9px;
	font-weight: 850;
	display: inline-flex;
}

.login-card .badge::before {
	content: "";
	background: currentColor;
	border-radius: 50%;
	width: 5px;
	height: 5px;
	margin-right: 6px;
}

.login-card h2 {
	margin: 18px 0 5px;
	font-size: 29px;
	font-weight: 850;
}

.login-card > p {
	color: var(--muted);
	margin: 0 0 4px;
	font-size: 14px;
	line-height: 1.4;
}

.login-card > p.login-lead {
	font-size: 13px;
	line-height: 1.35;
}

.login-card .login-error {
	background: #fff4f0;
	border: 1px solid #efcfc3;
	border-radius: 10px;
	color: #a4492e;
	margin: 14px 0 0;
	padding: 10px 12px;
	font-size: 12px;
}

.login-card > label,
.login-card .login-field {
	gap: 7px;
	margin-top: 20px;
	font-size: 11px;
	font-weight: 750;
	display: grid;
}

.login-card input[type="text"],
.login-card input[type="email"],
.login-card input[type="password"] {
	background: #fff;
	border: 1px solid #dcd6cc;
	border-radius: 9px;
	min-height: 44px;
	padding: 10px 12px;
	font-size: 14px;
	color: var(--ink);
	width: 100%;
	box-sizing: border-box;
}
.login-card .coedpi-pwd-wrap > input {
	padding-right: 44px;
}

.login-card input:focus {
	outline: 2px solid #e5bd1866;
	border-color: var(--gold);
}

.login-help {
	justify-content: space-between;
	align-items: center;
	margin: 14px 0 20px;
	font-size: 11px;
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.login-help label {
	color: var(--muted);
	align-items: center;
	gap: 7px;
	display: flex;
	font-weight: 600;
	margin: 0;
}

.login-help input[type="checkbox"] {
	accent-color: var(--gold);
	width: auto;
	min-height: auto;
}

.login-help a,
.login-help .lost-link,
.login-reset-actions .lost-link {
	color: var(--olive);
	background: 0 0;
	border: 0;
	font-size: 11px;
	cursor: pointer;
	padding: 0;
	font: inherit;
	text-decoration: underline;
}

.login-reset-msg {
	margin: 0 0 14px;
	font-size: 13px;
	color: var(--muted);
	line-height: 1.45;
}

.login-reset-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 16px;
	margin-top: 14px;
	justify-content: space-between;
}

.coedpi-otp-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(33, 28, 8, 0.32);
	backdrop-filter: blur(2px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 5vw;
}

.coedpi-otp-overlay[hidden] {
	display: none !important;
}

body.coedpi-otp-open {
	overflow: hidden;
}

/* Misma tarjeta que el login: badge, tipografía, inputs y botón oro. */
.login-card.coedpi-otp-modal {
	position: relative;
	width: min(460px, 100%);
	max-width: 460px;
	margin: 0;
	padding: 36px;
	box-shadow: 0 24px 60px rgba(33, 28, 18, 0.22);
	border: 1px solid rgba(255, 255, 255, 0.65);
	animation: coedpiPwdPop 0.28s ease-out;
}

.login-card.coedpi-otp-modal .coedpi-otp-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 36px;
	height: 36px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--ivory);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: var(--muted);
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.login-card.coedpi-otp-modal .coedpi-otp-close:hover {
	border-color: var(--gold);
	color: var(--ink);
}

.login-card.coedpi-otp-modal > h2 {
	padding-right: 36px;
}

.login-card.coedpi-otp-modal .btn {
	margin-top: 8px;
}

.login-card.coedpi-otp-modal .login-help {
	margin-top: 16px;
	margin-bottom: 0;
}

.login-card.coedpi-otp-modal .login-ok {
	margin-top: 14px;
}

.login-card.coedpi-otp-modal #coedpi-otp-code {
	letter-spacing: 0.28em;
	font-weight: 750;
	font-size: 18px;
	text-align: center;
}

#coedpi-otp-step-id[hidden],
#coedpi-otp-step-code[hidden],
#coedpi-otp-step-pwd[hidden],
#coedpi-otp-error[hidden] {
	display: none !important;
}

.login-card .btn,
.login-card button.btn,
.login-card input[type="submit"].btn {
	border: 0;
	border-radius: 999px;
	justify-content: center;
	align-items: center;
	gap: 10px;
	min-height: 46px;
	padding: 9px 21px;
	font-size: 13px;
	font-weight: 800;
	display: inline-flex;
	cursor: pointer;
	width: 100% !important;
	background: var(--gold);
	color: #211c08;
	box-shadow: 0 6px 16px #e5bd182e;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.login-card .btn:hover,
.login-card input[type="submit"].btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 20px #e5bd1838;
}

.login-card > small,
.login-card .login-footnote {
	text-align: center;
	margin-top: 18px;
	font-size: 10px;
	color: var(--muted);
	display: block;
	line-height: 1.4;
}

.login-card .login-ok {
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
	border-radius: 10px;
	padding: 10px 12px;
	margin: 0 0 14px;
	font-size: 12px;
	font-weight: 650;
}

body.coedpi-establecer-password .login-page::before {
	content: "";
	position: fixed;
	inset: 0;
	background: rgba(33, 28, 18, 0.28);
	pointer-events: none;
	z-index: 0;
}

body.coedpi-establecer-password .login-layout,
body.coedpi-establecer-password .public-header {
	position: relative;
	z-index: 1;
}

body.coedpi-establecer-password .pwd-modal {
	box-shadow: 0 24px 60px rgba(33, 28, 18, 0.22);
	border: 1px solid rgba(255, 255, 255, 0.65);
	animation: coedpiPwdPop 0.28s ease-out;
}

@keyframes coedpiPwdPop {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

#coedpi-pwd-step-pass[hidden],
#coedpi-pwd-step-email[hidden],
.login-error[hidden],
.login-ok[hidden] {
	display: none !important;
}

@media (max-width: 1100px) {
	.login-page {
		background: #faf7ef;
		width: 100%;
		max-width: 100%;
		overflow-x: hidden;
	}
	.public-header {
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
	}
	.login-layout {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"intro"
			"card";
		width: 100%;
		max-width: 100%;
		padding: 28px 4vw 48px;
		gap: 24px;
		row-gap: 24px;
		align-items: start;
		justify-items: stretch;
		box-sizing: border-box;
		min-width: 0;
	}
	.login-intro {
		grid-area: intro;
		align-self: start;
		justify-self: stretch;
		width: 100%;
		max-width: 100%;
		min-width: 0;
		margin: 0;
		text-align: left !important;
		box-sizing: border-box;
	}
	.login-intro .eyebrow,
	.login-intro h1,
	.login-intro p {
		text-align: left !important;
	}
	.login-intro > p:not(.eyebrow) {
		max-width: none;
		margin-left: 0;
		margin-right: 0;
		text-align: left !important;
	}
	.login-intro h1 {
		font-size: clamp(32px, 8vw, 52px);
	}
	.feature-row {
		display: none;
	}
	.login-card > p.login-lead {
		font-size: clamp(9px, 2.6vw, 12px);
		line-height: 1.3;
		white-space: normal;
		overflow: visible;
		text-overflow: unset;
		margin: 0 0 2px;
	}
	.card.login-card,
	.login-card {
		grid-area: card;
		justify-self: stretch;
		align-self: start;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		box-sizing: border-box;
	}
	.public-header > span {
		display: none;
	}
}

@media (min-width: 561px) and (max-width: 1100px) {
	.card.login-card,
	.login-card {
		max-width: 460px !important;
		justify-self: center;
		margin-left: auto !important;
		margin-right: auto !important;
	}
	.login-intro {
		max-width: none;
		margin-left: 0;
		margin-right: 0;
		text-align: left !important;
	}
	.login-intro .eyebrow,
	.login-intro h1,
	.login-intro p {
		text-align: left !important;
	}
}

/* Recuadro «Acceso directo» / PWA (login) */
.coedpi-pwa-install {
	margin: 16px 0 0;
	padding: 14px;
	border: 1px solid rgba(229, 189, 24, 0.42);
	border-radius: 14px;
	background: var(--gold-soft, #fff8da);
	box-shadow: var(--small-shadow, 0 4px 15px #4d3d190f);
	display: grid;
	gap: 10px;
	text-align: left;
}
.coedpi-pwa-install[hidden],
.coedpi-pwa-install.is-hidden {
	display: none !important;
}
.coedpi-pwa-install__head {
	display: flex;
	align-items: center;
	gap: 12px;
	text-align: left;
}
.coedpi-pwa-install__logo {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	flex: 0 0 auto;
	background: #0b0b0b;
	object-fit: cover;
	box-shadow: 0 2px 8px #211c0820;
}
.coedpi-pwa-install__copy {
	display: grid;
	gap: 2px;
	min-width: 0;
}
.coedpi-pwa-install__copy strong {
	font-size: 14px;
	font-weight: 800;
	color: var(--ink, #211c08);
	line-height: 1.25;
}
.coedpi-pwa-install__copy span {
	font-size: 12px;
	line-height: 1.35;
	color: var(--muted, #7a7364);
}
.coedpi-pwa-install__btn {
	width: 100%;
	justify-content: center;
	font-weight: 800;
}
.coedpi-pwa-install__dismiss {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 12px;
	line-height: 1.35;
	color: var(--muted, #7a7364);
	cursor: pointer;
	user-select: none;
}
.coedpi-pwa-install__dismiss input {
	margin: 0;
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
}
.coedpi-pwa-install__tip {
	font-size: 12px;
	line-height: 1.45;
	color: var(--muted, #7a7364);
	margin: 0;
}
.coedpi-pwa-install__tip p {
	margin: 0;
}
.coedpi-pwa-install__tip[hidden],
.coedpi-pwa-install__tip.is-hidden,
.coedpi-pwa-tip[hidden],
.coedpi-pwa-tip.is-hidden {
	display: none !important;
}

/* Pago de seguro público: no heredar el grid/max-width 460px del login */
body.coedpi-pago-seguro-public {
	overflow-x: hidden;
}
body.coedpi-pago-seguro-public .pago-seguro-page {
	background: #faf7ef;
	min-height: 100vh;
	min-height: 100dvh;
	width: 100%;
	max-width: 100%;
}
body.coedpi-pago-seguro-public .pago-seguro-shell {
	display: block;
	width: 100%;
	max-width: 40rem;
	margin: 0 auto;
	padding: 28px 24px 48px;
	padding-left: max(24px, env(safe-area-inset-left, 0px));
	padding-right: max(24px, env(safe-area-inset-right, 0px));
	padding-bottom: max(48px, env(safe-area-inset-bottom, 0px));
	box-sizing: border-box;
	min-height: 0;
}
body.coedpi-pago-seguro-public .pago-seguro-card,
body.coedpi-pago-seguro-public .card.login-card,
body.coedpi-pago-seguro-public .login-card {
	display: block;
	width: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 28px 28px 24px;
	align-self: auto;
	justify-self: stretch;
	grid-area: auto;
	box-sizing: border-box;
}
body.coedpi-pago-seguro-public .pago-seguro-card .btn,
body.coedpi-pago-seguro-public .login-card .btn {
	width: 100% !important;
	box-sizing: border-box;
}

@media (max-width: 720px) {
	body.coedpi-pago-seguro-public .public-header {
		height: 56px;
		padding: 0 16px;
		padding-left: max(16px, env(safe-area-inset-left, 0px));
		padding-right: max(16px, env(safe-area-inset-right, 0px));
	}
	body.coedpi-pago-seguro-public .public-header > span {
		display: none;
	}
	body.coedpi-pago-seguro-public .brand strong {
		font-size: 13px;
	}
	body.coedpi-pago-seguro-public .pago-seguro-shell {
		padding: 12px 12px 40px;
		padding-left: max(12px, env(safe-area-inset-left, 0px));
		padding-right: max(12px, env(safe-area-inset-right, 0px));
		padding-bottom: max(40px, env(safe-area-inset-bottom, 0px));
	}
	body.coedpi-pago-seguro-public .pago-seguro-card,
	body.coedpi-pago-seguro-public .card.login-card,
	body.coedpi-pago-seguro-public .login-card {
		padding: 18px 16px 20px;
		border-radius: 14px;
		box-shadow: 0 8px 28px #604d1d14;
	}
}

@media (max-width: 400px) {
	body.coedpi-pago-seguro-public .pago-seguro-shell {
		padding: 8px 8px 36px;
		padding-left: max(8px, env(safe-area-inset-left, 0px));
		padding-right: max(8px, env(safe-area-inset-right, 0px));
	}
	body.coedpi-pago-seguro-public .pago-seguro-card,
	body.coedpi-pago-seguro-public .card.login-card,
	body.coedpi-pago-seguro-public .login-card {
		padding: 16px 12px 18px;
		border-radius: 12px;
	}
}
