/* Tarificador de salud reducido (un solo paso).
   Mismo aspecto que los tarificadores de la intranet (css/tarificador-tema.css): cabecera azul,
   tarjetas blancas, secciones numeradas y boton naranja. Todo va dentro de .tsr para no
   chocar con el CSS de la web (Bootstrap) ni con el de otros tarificadores. */

.tsr {
	--azul: #1d4a8b;
	--azul-oscuro: #0e2448;
	--azul-suave: #e8eef8;
	--naranja: #ff5a0a;
	--naranja-oscuro: #e64a00;
	--naranja-suave: #fff1e8;
	--verde: #2f9e5b;
	--verde-suave: #e8f6ee;
	--rojo: #c62828;
	--rojo-suave: #fdecec;
	--fondo-campo: #f7f9fc;
	--texto: #1b2433;
	--texto-suave: #5d6b82;
	--linea: #e3e8f0;
	--linea-fuerte: #d3dbe7;
	--radio: 14px;
	--sombra: 0 1px 2px rgba(16, 32, 64, .06), 0 8px 28px rgba(16, 32, 64, .08);

	max-width: 860px;
	margin: 28px auto 48px;
	color: var(--texto);
	font: 15px/1.45 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	text-align: left;
}
.tsr *, .tsr *::before, .tsr *::after { box-sizing: border-box; }
.tsr [hidden] { display: none !important; }
.tsr svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tsr-aviso-js { padding: 14px 18px; border-radius: 10px; background: var(--rojo-suave); color: var(--rojo); font-weight: 600; }

/* ---------- Cabecera ---------- */
.tsr-cabecera {
	position: relative;
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 24px 28px;
	border-radius: 18px;
	background:
		radial-gradient(circle at 92% -20%, rgba(255, 90, 10, .35), transparent 45%),
		linear-gradient(120deg, #1b437f 0%, #15356a 55%, #0e2448 100%);
	color: #fff;
	box-shadow: 0 10px 30px rgba(14, 36, 72, .25);
	overflow: hidden;
}
.tsr-cabecera::after {
	content: "";
	position: absolute;
	right: -60px;
	top: -80px;
	width: 260px;
	height: 260px;
	border: 40px solid rgba(255, 255, 255, .04);
	border-radius: 50%;
	pointer-events: none;
}
.tsr-cabecera-icono {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	flex: none;
	border: 1px solid rgba(255, 255, 255, .15);
	border-radius: 14px;
	background: rgba(255, 255, 255, .08);
	color: #ff7a35;
}
.tsr-cabecera-icono svg { width: 28px; height: 28px; }
.tsr-cabecera-texto { flex: 1; min-width: 0; }
.tsr .tsr-antetitulo {
	margin: 0 0 4px;
	color: #ffa36e;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
}
.tsr .tsr-titulo { margin: 0; color: #fff; font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.tsr .tsr-subtitulo { margin: 6px 0 0; color: rgba(255, 255, 255, .78); font-size: 14px; }

.tsr-pasos {
	position: relative;
	z-index: 1;
	display: flex;
	gap: 4px;
	margin: 0;
	padding: 5px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .1);
	list-style: none;
}
.tsr-pasos li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px 6px 6px;
	border-radius: 999px;
	color: rgba(255, 255, 255, .7);
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}
.tsr-pasos li span {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .15);
	font-size: 12px;
}
.tsr-pasos li.activo { background: #fff; color: var(--texto); }
.tsr-pasos li.activo span { background: var(--naranja); color: #fff; }

/* ---------- Tarjeta y secciones ---------- */
.tsr-tarjeta {
	margin: 16px 0 0;
	padding: 8px 32px 28px;
	border: 1px solid var(--linea);
	border-radius: 18px;
	background: #fff;
	box-shadow: var(--sombra);
}
.tsr-seccion { padding: 24px 0; border-bottom: 1px solid var(--linea); }
.tsr-seccion-titulo {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 14px !important;
	color: var(--texto) !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	letter-spacing: .02em;
	text-transform: uppercase;
}
.tsr-num {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	flex: none;
	border-radius: 50%;
	background: var(--naranja-suave);
	color: var(--naranja);
	font-size: 13px;
	font-weight: 700;
}
.tsr .tsr-ayuda { margin: -6px 0 14px 40px; color: var(--texto-suave); font-size: 14px; }

/* ---------- Campos ---------- */
.tsr-rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.tsr-rejilla-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tsr-campo { min-width: 0; }
.tsr-campo > label {
	display: block;
	margin: 0 0 6px;
	color: var(--texto-suave);
	font-size: 13px;
	font-weight: 600;
}
.tsr input[type=text], .tsr input[type=tel], .tsr input[type=email], .tsr select {
	display: block;
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--linea-fuerte);
	border-radius: 10px;
	background: #fff;
	color: var(--texto);
	font: inherit;
	font-size: 16px; /* 16px: en el movil no hace zoom al escribir */
	box-shadow: none;
	transition: border-color .15s, box-shadow .15s;
}
.tsr select {
	padding-right: 40px;
	-webkit-appearance: none;
	appearance: none;
	background: #fff no-repeat right 14px center / 16px
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6b82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	cursor: pointer;
}
.tsr input::placeholder { color: #9aa6b8; opacity: 1; }
.tsr input:hover, .tsr select:hover { border-color: #b8c4d6; }
.tsr input:focus, .tsr select:focus {
	outline: none;
	border-color: var(--azul);
	box-shadow: 0 0 0 4px rgba(29, 74, 139, .12);
}
.tsr .con-error input, .tsr input.con-error { border-color: var(--rojo); background: #fffafa; }
.tsr .con-error input:focus, .tsr input.con-error:focus { box-shadow: 0 0 0 4px rgba(198, 40, 40, .12); }
.tsr .tsr-error { min-height: 0; margin: 6px 0 0; color: var(--rojo); font-size: 13px; font-weight: 600; }
.tsr .tsr-error:empty { display: none; }

/* Codigo postal con la provincia dentro */
.tsr-con-etiqueta { position: relative; }
.tsr-provincia {
	position: absolute;
	top: 50%;
	right: 8px;
	max-width: 60%;
	padding: 4px 10px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--verde-suave);
	color: var(--verde);
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
	text-overflow: ellipsis;
	transform: translateY(-50%);
	pointer-events: none;
}
.tsr-provincia:empty { display: none; }

/* ---------- Asegurados ---------- */
.tsr-asegurados { display: grid; gap: 10px; }
.tsr-asegurado {
	display: grid;
	grid-template-columns: 120px minmax(0, 1fr) 40px;
	align-items: center;
	gap: 6px 14px;
	padding: 12px 14px;
	border: 1px solid var(--linea);
	border-radius: 12px;
	background: var(--fondo-campo);
	animation: tsr-entra .2s ease-out;
}
@keyframes tsr-entra { from { opacity: 0; transform: translateY(-4px); } }
.tsr-asegurado-nombre { margin: 0; color: var(--texto); font-size: 14px; font-weight: 700; }
.tsr-asegurado-campo { position: relative; max-width: 300px; }
.tsr-asegurado .tsr-error { grid-column: 2 / 4; margin: 0; }
.tsr-edad {
	position: absolute;
	top: 50%;
	right: 8px;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--azul-suave);
	color: var(--azul);
	font-size: 12px;
	font-weight: 700;
	transform: translateY(-50%);
	pointer-events: none;
}
.tsr-edad:empty { display: none; }
.tsr .tsr-quitar {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--linea-fuerte);
	border-radius: 10px;
	background: #fff;
	color: var(--texto-suave);
	cursor: pointer;
}
.tsr .tsr-quitar:hover { border-color: var(--rojo); background: var(--rojo-suave); color: var(--rojo); }
.tsr .tsr-anadir {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 12px 0 0;
	padding: 10px 16px;
	border: 1px dashed #b8c4d6;
	border-radius: 10px;
	background: #fff;
	color: var(--azul);
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}
.tsr .tsr-anadir:hover { border-color: var(--azul); background: var(--azul-suave); }
.tsr .tsr-anadir:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Opciones en botones (mutualidad, motivo) ---------- */
.tsr-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.tsr-chip { position: relative; margin: 0; cursor: pointer; }
.tsr-chip input { position: absolute; opacity: 0; pointer-events: none; }
.tsr-chip span {
	display: block;
	min-width: 120px;
	padding: 12px 20px;
	border: 1px solid var(--linea-fuerte);
	border-radius: 12px;
	background: #fff;
	color: var(--texto);
	font-weight: 700;
	text-align: center;
	transition: border-color .15s, background-color .15s, color .15s;
}
.tsr-chip:hover span { border-color: var(--azul); }
.tsr-chip input:checked + span { border-color: var(--azul); background: var(--azul); color: #fff; box-shadow: 0 4px 12px rgba(29, 74, 139, .25); }
.tsr-chip input:focus-visible + span { box-shadow: 0 0 0 4px rgba(29, 74, 139, .2); }

/* ---------- Aviso legal ---------- */
.tsr-legal { margin: 18px 0 0; }
.tsr-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; cursor: pointer; }
.tsr-check input[type=checkbox] {
	width: 20px;
	height: 20px;
	flex: none;
	margin: 1px 0 0;
	accent-color: var(--naranja);
	cursor: pointer;
}
.tsr-check-texto { color: var(--texto-suave); font-size: 13px; line-height: 1.5; }
/* El texto legal de la web («Sus datos son tratados por...»), en letra pequeña como en los banners */
.tsr-check-texto p { margin: 0 0 6px; font-size: 8.5px; line-height: 1.4; }
.tsr-check-texto p:last-child { margin-bottom: 0; }
.tsr-check-texto a { color: var(--azul); font-weight: 600; text-decoration: underline; }
.tsr-legal.con-error .tsr-check input { outline: 2px solid var(--rojo); outline-offset: 2px; }

/* ---------- Pie y boton ---------- */
.tsr-pie {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px 24px;
	padding: 24px 0 0;
}
.tsr-garantias { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; list-style: none; }
.tsr-garantias li { display: flex; align-items: center; gap: 6px; color: var(--texto-suave); font-size: 13px; font-weight: 600; }
.tsr-garantias svg { width: 16px; height: 16px; color: var(--verde); }
.tsr .tsr-enviar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 220px;
	height: 54px;
	margin: 0;
	padding: 0 28px;
	border: 0;
	border-radius: 12px;
	background: linear-gradient(180deg, #ff7a35 0%, var(--naranja) 55%, var(--naranja-oscuro) 100%);
	color: #fff;
	font: inherit;
	font-size: 17px;
	font-weight: 700;
	box-shadow: 0 8px 20px rgba(255, 90, 10, .3);
	cursor: pointer;
	transition: transform .15s, box-shadow .15s;
}
.tsr .tsr-enviar:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(255, 90, 10, .38); }
.tsr .tsr-enviar:focus-visible { outline: 3px solid rgba(255, 90, 10, .4); outline-offset: 3px; }
.tsr .tsr-enviar:disabled { opacity: .7; cursor: wait; transform: none; }
.tsr .tsr-enviar svg { width: 20px; height: 20px; }

.tsr-resumen-error {
	margin: 20px 0 0;
	padding: 12px 16px;
	border: 1px solid #f5c2c2;
	border-radius: 10px;
	background: var(--rojo-suave);
	color: var(--rojo);
	font-size: 14px;
	font-weight: 600;
}

/* Trampa para robots: fuera de la pantalla, no con display:none (algunos robots lo detectan) */
.tsr-trampa { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Calculando ---------- */
.tsr-cargando {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: grid;
	place-items: center;
	padding: 16px;
	background: rgba(14, 36, 72, .55);
	backdrop-filter: blur(3px);
}
.tsr-cargando-caja {
	max-width: 360px;
	padding: 30px 28px;
	border-radius: 18px;
	background: #fff;
	box-shadow: var(--sombra);
	text-align: center;
}
.tsr-cargando-caja p { margin: 16px 0 0; color: var(--texto-suave); font-size: 14px; }
.tsr-cargando-caja strong { color: var(--texto); font-size: 17px; }
.tsr-spinner {
	width: 48px;
	height: 48px;
	margin: 0 auto;
	border: 4px solid var(--azul-suave);
	border-top-color: var(--naranja);
	border-radius: 50%;
	animation: tsr-gira .8s linear infinite;
}
@keyframes tsr-gira { to { transform: rotate(360deg); } }

/* ---------- Estrecho (movil, o metido en media columna de una landing) ----------
   Se mide el ancho de .tsr-marco, no el de la pantalla (container queries). */
.tsr-marco { container-type: inline-size; }
@media (max-width: 600px) {
	.tsr { margin: 16px auto 32px; }
}
@container (max-width: 820px) {
	.tsr-cabecera { flex-wrap: wrap; }
	.tsr-pasos { order: 3; width: 100%; padding: 0; background: none; }
	.tsr-rejilla-3 { grid-template-columns: 1fr 1fr; }
	.tsr-rejilla-3 .tsr-campo:last-child { grid-column: 1 / -1; }
}
@container (max-width: 600px) {
	.tsr-cabecera { padding: 20px 18px; gap: 14px; border-radius: 16px; }
	.tsr-cabecera-icono { width: 46px; height: 46px; }
	.tsr .tsr-titulo { font-size: 21px; }
	.tsr-tarjeta { padding: 4px 18px 22px; border-radius: 16px; }
	.tsr-rejilla, .tsr-rejilla-3 { grid-template-columns: 1fr; }
	.tsr .tsr-ayuda { margin-left: 0; }
	.tsr-asegurado { grid-template-columns: minmax(0, 1fr) 36px; padding: 12px; }
	.tsr-asegurado-nombre { grid-column: 1 / -1; }
	.tsr-asegurado-campo { max-width: none; }
	.tsr-asegurado .tsr-error { grid-column: 1 / -1; }
	.tsr-chip { flex: 1; }
	.tsr-chip span { min-width: 0; }
	.tsr-pie { flex-direction: column-reverse; align-items: stretch; }
	.tsr .tsr-enviar { width: 100%; }
	.tsr-garantias { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
	.tsr *, .tsr *::before, .tsr *::after { animation: none !important; transition: none !important; }
	.tsr-spinner { animation: tsr-gira 1.6s linear infinite !important; }
}
