:root {
	--verde: #1f5c28;
	--verde-claro: #2f7d38;
	--verde-suave: #e8f5ea;
	--fondo: #eef3ef;
	--texto: #1c2420;
	--muted: #5d6f64;
	--linea: #d5e0d8;
	--aviso: #c2410c;
	--sombra: 0 10px 30px rgba(24, 58, 30, 0.08);
	--radio: 20px;
}

* { box-sizing: border-box; }

html, body { max-width: 100%; }

body {
	margin: 0;
	background:
		radial-gradient(1200px 420px at 50% -180px, #d7ead9 0%, transparent 70%),
		var(--fondo);
	color: var(--texto);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	line-height: 1.45;
	-webkit-text-size-adjust: 100%;
}

[ng-cloak] { display: none !important; }

button, label, input, textarea { touch-action: manipulation; }

.app-top {
	position: sticky;
	top: 0;
	z-index: 4;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 64px;
	padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
	background: var(--verde);
	color: #fff;
	box-shadow: 0 8px 20px rgba(31, 92, 40, 0.18);
}

.app-top img {
	width: 40px;
	height: 40px;
	flex: none;
	object-fit: contain;
	background: #fff;
	border-radius: 12px;
	padding: 4px;
}

.app-marca {
	min-width: 0;
	flex: 1;
}

.app-top strong,
.app-top small { display: block; }

.app-top strong { font-size: 1.05rem; letter-spacing: -0.01em; }

.app-top small {
	opacity: 0.88;
	font-size: 0.82rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.app-acciones {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: none;
}

.btn-salir {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	border: 1px solid rgba(255, 255, 255, 0.45);
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	border-radius: 999px;
	padding: 6px 14px;
	font-weight: 700;
}

.reloj-pill {
	min-width: 76px;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.03em;
}

.reloj-pill.is-aviso,
.reloj-pill.is-fin {
	background: rgba(255, 255, 255, 0.28);
	border-color: #fff;
}

.app-main {
	width: min(720px, 100%);
	margin: 0 auto;
	padding: 16px 16px calc(28px + env(safe-area-inset-bottom));
}

.app-main.con-barra {
	padding-bottom: calc(118px + env(safe-area-inset-bottom));
}

.app-card,
.prueba-card,
.pregunta-card {
	background: #fff;
	border: 1px solid rgba(213, 224, 216, 0.9);
	border-radius: var(--radio);
	padding: 18px 16px;
	box-shadow: var(--sombra);
}

.ingreso { margin-top: 12px; }

h1 {
	font-size: 1.7rem;
	line-height: 1.15;
	letter-spacing: -0.03em;
	margin: 0 0 8px;
}

h2 {
	font-size: 1.12rem;
	line-height: 1.35;
	margin: 0 0 8px;
	overflow-wrap: anywhere;
}

.ojo {
	margin: 0 0 6px;
	color: var(--verde-claro);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.app-ayuda, .descripcion { color: var(--muted); }

.descripcion {
	margin-bottom: 12px;
	overflow-wrap: anywhere;
}

label {
	display: block;
	margin: 16px 0 8px;
	font-weight: 700;
}

.form-control {
	width: 100%;
	min-height: 52px;
	padding: 12px 14px;
	border-radius: 14px;
	border: 1px solid #c5d4ca;
	background: #fbfdfb;
	font-size: 16px;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.form-control:focus {
	outline: none;
	border-color: #7dbe86;
	box-shadow: 0 0 0 4px rgba(47, 125, 56, 0.15);
}

textarea.form-control {
	min-height: 132px;
	resize: vertical;
}

.btn-verde {
	width: 100%;
	margin-top: 16px;
	min-height: 54px;
	border: 0;
	border-radius: 16px;
	background: var(--verde-claro);
	color: #fff;
	font-size: 1.05rem;
	font-weight: 800;
	box-shadow: 0 8px 16px rgba(47, 125, 56, 0.22);
}

.btn-verde:active { transform: translateY(1px); }
.btn-verde:disabled { opacity: 0.55; box-shadow: none; }

.btn-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	margin: -6px 0 4px -4px;
	padding: 8px;
	border: 0;
	background: transparent;
	color: var(--verde);
	font-weight: 800;
}

.app-error {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin: 14px 0 0;
	color: #b42318;
	font-weight: 700;
}

.app-vacio {
	margin-top: 18px;
	padding: 36px 18px;
	text-align: center;
	color: var(--muted);
	background: #fff;
	border-radius: var(--radio);
	border: 1px dashed #c5d4ca;
}

.app-vacio i { font-size: 2rem; color: var(--verde-claro); }

.prueba-card,
.pregunta-card { margin-bottom: 14px; }

.estado-pill {
	display: inline-block;
	margin: 0 0 8px;
	padding: 4px 10px;
	border-radius: 999px;
	background: #fff4e8;
	color: var(--aviso);
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.chips span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 34px;
	padding: 6px 10px;
	border-radius: 999px;
	background: var(--verde-suave);
	color: #24552c;
	font-size: 0.86rem;
	font-weight: 700;
}

.intro-datos {
	list-style: none;
	margin: 16px 0 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.intro-datos li {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 12px;
	border-radius: 16px;
	background: #f6faf7;
	color: #31463a;
}

.intro-datos i {
	width: 22px;
	margin-top: 2px;
	text-align: center;
	color: var(--verde-claro);
}

.numero {
	margin: 0 0 6px;
	color: var(--verde-claro);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.opcion {
	position: relative;
	display: flex;
	gap: 12px;
	align-items: flex-start;
	min-height: 58px;
	margin: 10px 0 0;
	padding: 14px;
	border: 1.5px solid #e1ebe4;
	border-radius: 16px;
	background: #fff;
	cursor: pointer;
}

.opcion.is-on {
	border-color: #67a86e;
	background: var(--verde-suave);
}

.opcion-check {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.opcion-marca {
	width: 24px;
	height: 24px;
	flex: none;
	margin-top: 1px;
	border: 2px solid #9bb4a2;
	border-radius: 50%;
	background: #fff;
}

.opcion.is-on .opcion-marca {
	border-color: var(--verde);
	background: var(--verde) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M6.2 11.2 3.1 8.1l1.1-1.1 2 2 5.6-5.6 1.1 1.1z'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.opcion-texto {
	min-width: 0;
	font-size: 1.02rem;
	overflow-wrap: anywhere;
}

.opcion img {
	display: block;
	width: 100%;
	max-height: 220px;
	margin-top: 10px;
	object-fit: contain;
	border-radius: 12px;
	border: 1px solid var(--linea);
	background: #fff;
}

.barra-envio {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 4;
	display: grid;
	gap: 8px;
	padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
	background: rgba(255, 255, 255, 0.96);
	border-top: 1px solid var(--linea);
	box-shadow: 0 -10px 24px rgba(24, 58, 30, 0.08);
	backdrop-filter: blur(12px);
}

.barra-envio p {
	margin: 0;
	text-align: center;
	color: var(--muted);
	font-size: 0.86rem;
	font-weight: 700;
}

.barra-envio .btn-verde { margin-top: 0; }

.cierre {
	text-align: center;
}

.cierre h1 { margin-top: 6px; }

.cierre-alerta {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	margin: 4px auto 14px;
	border-radius: 50%;
	background: #fff4e8;
	color: var(--aviso);
	font-size: 1.7rem;
}

body.vista-realizada {
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
}

body.vista-realizada .app-main.app-centro {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.resultado .nota {
	margin: 8px 0 4px;
	font-size: 3.4rem;
	line-height: 1;
	font-weight: 800;
	letter-spacing: -0.05em;
	color: var(--verde);
}

.resultado .nota span {
	font-size: 1.3rem;
	color: var(--muted);
	letter-spacing: 0;
}

.fechas {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-top: 14px;
}

.fechas span {
	padding: 10px;
	border-radius: 14px;
	background: #f6faf7;
	color: var(--muted);
	font-size: 0.78rem;
}

.fechas strong {
	display: block;
	margin-top: 2px;
	color: var(--texto);
	font-size: 0.84rem;
	overflow-wrap: anywhere;
}

@media (min-width: 768px) {
	.app-main { padding-top: 28px; }
	.app-card, .prueba-card, .pregunta-card { padding: 24px; }
	.ingreso { margin-top: 8vh; }
	.barra-envio {
		left: 50%;
		right: auto;
		width: min(720px, calc(100% - 32px));
		transform: translateX(-50%);
		border: 1px solid var(--linea);
		border-bottom: 0;
		border-radius: 20px 20px 0 0;
	}
}
