/**
 * Entrega del diseño por enlace o más tarde.
 *
 * Los tokens son los de tibor-vinilos (--tvc-*) con valor de respaldo, porque este
 * bloque también se usará en DTF y Merchandising, donde vinilos.css no carga.
 *
 * OJO: el tema NO tiene box-sizing: border-box global. Cualquier width:100% con
 * relleno se sale exactamente lo que sumen el padding y el borde, así que aquí se
 * declara de forma explícita.
 */

.tea,
.tea * {
	box-sizing: border-box;
}

.tea {
	margin: 14px 0 0;
	font-family: inherit;
}

/* ── Línea en reposo ─────────────────────────────────────────────────────────
   Es lo ÚNICO que se ve si el cliente no despliega. Peso visual bajo a propósito:
   el dropzone de arriba sigue siendo la acción principal. */

.tea-toggle {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 2px;
	margin: 0;
	border: 0;
	background: none;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.4;
	text-align: left;
	color: var(--tvc-ink-2, #425a72);
	transition: color .15s ease;
}

.tea-toggle:hover,
.tea-toggle:focus-visible {
	color: var(--tvc-navy, #0b3989);
}

.tea-toggle-a {
	font-weight: 700;
	color: var(--tvc-navy, #0b3989);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tea-chev {
	width: 16px;
	height: 16px;
	flex: 0 0 16px;
	color: var(--tvc-navy, #0b3989);
	transition: transform .18s ease;
}

.tea.is-open .tea-chev {
	transform: rotate(180deg);
}

/* ── Panel desplegado ────────────────────────────────────────────────────────
   Law of Common Region: un solo contenedor con fondo propio agrupa las dos vías
   alternativas y las separa visualmente del dropzone, sin anidar más niveles. */

.tea-panel {
	margin-top: 6px;
	padding: 16px;
	background: var(--tvc-surface-2, #eef4f9);
	border: 1px solid var(--tvc-border, #e2ecf3);
	border-radius: var(--tvc-radius, 12px);
}

.tea-panel[hidden] {
	display: none;
}

/* ── Opciones ────────────────────────────────────────────────────────────── */

.tea-opts {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tea-opt {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	padding: 12px 14px;
	background: var(--tvc-surface, #fff);
	border: 1px solid var(--tvc-border, #e2ecf3);
	border-radius: var(--tvc-radius-sm, 9px);
	cursor: pointer;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.tea-opt:hover {
	border-color: var(--tvc-border-strong, #cddceb);
}

.tea-opt input[type="radio"] {
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	margin: 2px 0 0;
	accent-color: var(--tvc-navy, #0b3989);
	cursor: pointer;
}

.tea-opt:has(input:checked) {
	border-color: var(--tvc-navy, #0b3989);
	box-shadow: 0 0 0 1px var(--tvc-navy, #0b3989);
}

.tea-opt input:focus-visible {
	outline: 2px solid var(--tvc-navy, #0b3989);
	outline-offset: 2px;
}

.tea-opt-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0; /* si no, un texto largo desborda la tarjeta */
}

.tea-opt-t {
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--tvc-ink, #0d2438);
}

.tea-opt-d {
	font-size: 13px;
	line-height: 1.45;
	color: var(--tvc-muted, #718096);
}

/* ── Campo del enlace ────────────────────────────────────────────────────────
   Etiqueta persistente arriba, ayuda entre etiqueta y campo, error debajo.
   Nunca el placeholder como única etiqueta. */

.tea-link {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--tvc-border, #e2ecf3);
}

.tea-link[hidden] {
	display: none;
}

.tea-label {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: var(--tvc-ink, #0d2438);
}

.tea-help {
	display: block;
	margin-top: 2px;
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--tvc-muted, #718096);
}

.tea-input-wrap {
	position: relative;
	margin-top: 8px;
}

.tea-input {
	width: 100%;
	height: 46px;
	padding: 0 40px 0 13px;
	background: var(--tvc-surface, #fff);
	border: 1px solid var(--tvc-border-strong, #cddceb);
	border-radius: var(--tvc-radius-sm, 9px);
	font-size: 15px;
	font-family: inherit;
	color: var(--tvc-ink, #0d2438);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.tea-input:focus {
	outline: none;
	border-color: var(--tvc-navy, #0b3989);
	box-shadow: 0 0 0 3px rgba(11, 57, 137, .12);
}

.tea-input::placeholder {
	color: #a8b8c8;
}

.tea.is-error .tea-input {
	border-color: #c62828;
}

.tea.is-error .tea-input:focus {
	box-shadow: 0 0 0 3px rgba(198, 40, 40, .12);
}

/* Checkmark de éxito: acertar con una URL no es evidente a simple vista. */
.tea-ok {
	position: absolute;
	top: 50%;
	right: 13px;
	width: 17px;
	height: 17px;
	margin-top: -8px;
	color: #2e7d32;
	opacity: 0;
	transform: scale(.7);
	transition: opacity .15s ease, transform .15s ease;
	pointer-events: none;
}

.tea.is-ok[data-modo="enlace"] .tea-ok {
	opacity: 1;
	transform: scale(1);
}

.tea-err {
	margin: 7px 0 0;
	font-size: 13px;
	line-height: 1.45;
	color: #c62828;
}

.tea-err[hidden] {
	display: none;
}

.tea-note {
	margin: 8px 0 0;
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--tvc-muted, #718096);
}

/* ── Confirmación ────────────────────────────────────────────────────────── */

.tea-done {
	display: flex;
	margin: 14px 0 0;
	padding: 11px 13px;
	background: #eaf6ec;
	border-left: 3px solid #2e7d32;
	border-radius: 0 var(--tvc-radius-sm, 9px) var(--tvc-radius-sm, 9px) 0;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.45;
	color: #1b5e20;
	overflow-wrap: anywhere;
}

.tea-done[hidden] {
	display: none;
}

@media (max-width: 480px) {
	.tea-panel {
		padding: 13px;
	}

	.tea-opt {
		padding: 11px 12px;
	}
}
