/*
 * Estilos del plugin Agentes — Programa de Agencias Colaboradoras.
 * Pendiente de sustituir por el CSS corporativo de nuevavaldeluz.es (sección 3
 * del briefing, todavía en desarrollo por el cliente). Mientras tanto, se
 * define aquí un sistema de tokens (custom properties) para que ese cambio
 * futuro sea, en su mayor parte, sustituir los valores de :root.
 */

.agentes-wrap {
	--agentes-bg: #f2f9f8;
	--agentes-surface: #ffffff;
	--agentes-surface-alt: #e9f6f4;
	--agentes-ink: #1b2524;
	--agentes-muted: #5c6d6a;
	--agentes-line: #d2e6e3;
	--agentes-accent: #40c1ac;
	--agentes-accent-deep: #1c6459;
	--agentes-danger: #c0392b;
	--agentes-danger-bg: #fbeae8;
	--agentes-font-display: "Fraunces", Georgia, "Times New Roman", serif;
	--agentes-font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

	max-width: 720px;
	margin: 2.5rem auto;
	padding: 0 1rem;
	font-family: var(--agentes-font-body);
	color: var(--agentes-ink);
	line-height: 1.5;
}

.agentes-wrap--panel {
	max-width: 960px;
}

.agentes-wrap h1,
.agentes-wrap h2,
.agentes-wrap h3 {
	font-family: var(--agentes-font-display);
	font-weight: 600;
	line-height: 1.25;
	color: var(--agentes-ink);
}

.agentes-wrap h2 {
	font-size: 1.5rem;
	margin: 0 0 1.25rem;
}

.agentes-wrap h3 {
	font-size: 1.15rem;
	margin: 0 0 1rem;
}

.agentes-wrap a {
	color: var(--agentes-accent-deep);
}

/* -----------------------------------------------------------------------
 * Marcador de progreso del alta (4 pasos)
 * --------------------------------------------------------------------- */
.agentes-progreso {
	display: flex;
	list-style: none;
	margin: 0 0 2rem;
	padding: 0;
	gap: 0.5rem;
}

.agentes-progreso__paso {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.5rem;
}

.agentes-progreso__marca {
	display: block;
	width: 100%;
	height: 3px;
	background: var(--agentes-line);
	border-radius: 0;
}

.agentes-progreso__paso--hecho .agentes-progreso__marca {
	background: var(--agentes-accent-deep);
}

.agentes-progreso__paso--activo .agentes-progreso__marca {
	background: var(--agentes-accent);
}

.agentes-progreso__etiqueta {
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--agentes-muted);
}

.agentes-progreso__paso--activo .agentes-progreso__etiqueta {
	color: var(--agentes-ink);
	font-weight: 600;
}

.agentes-progreso__paso--hecho .agentes-progreso__etiqueta {
	color: var(--agentes-accent-deep);
}

/* -----------------------------------------------------------------------
 * Pantalla "¿Ya eres agencia colaboradora?" — dos columnas con línea divisoria
 * --------------------------------------------------------------------- */
.agentes-elegir {
	display: flex;
	flex-wrap: wrap;
}

.agentes-elegir__login,
.agentes-elegir__registro {
	flex: 1 1 280px;
	padding: 0 2rem;
}

.agentes-elegir__login {
	padding-left: 0;
}

.agentes-elegir__registro {
	border-left: 1px solid var(--agentes-line);
}

/* Formulario de login nativo de WordPress (wp_login_form) */
#loginform {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

#loginform p {
	margin: 0;
}

#loginform label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 500;
	font-size: 0.9rem;
	color: var(--agentes-muted);
}

#loginform input[type="text"],
#loginform input[type="password"],
.agentes-wrap input[type="text"],
.agentes-wrap input[type="email"],
.agentes-wrap input[type="password"],
.agentes-wrap select {
	width: 100%;
	box-sizing: border-box;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--agentes-line);
	border-radius: 3px;
	background: var(--agentes-surface);
	color: var(--agentes-ink);
	font-family: var(--agentes-font-body);
	font-size: 1rem;
}

#loginform input[type="text"]:focus,
#loginform input[type="password"]:focus,
.agentes-wrap input:focus,
.agentes-wrap select:focus {
	outline: none;
	border-color: var(--agentes-accent);
	box-shadow: 0 0 0 3px rgba(64, 193, 172, 0.22);
}

.login-remember {
	font-weight: 400 !important;
	display: flex !important;
	align-items: center;
	gap: 0.4rem;
	color: var(--agentes-muted);
}

.login-remember label {
	font-weight: 400 !important;
	display: flex !important;
	align-items: center;
	gap: 0.4rem;
	margin: 0 !important;
}

.login-submit {
	margin-top: 0.25rem !important;
}

/* -----------------------------------------------------------------------
 * Botones
 * --------------------------------------------------------------------- */
.agentes-wrap .button,
.agentes-wrap button,
.agentes-wrap input[type="submit"] {
	display: inline-block;
	padding: 0.7rem 1.5rem;
	border-radius: 3px;
	border: 1px solid var(--agentes-accent);
	background: var(--agentes-accent);
	color: var(--agentes-ink);
	font-family: var(--agentes-font-body);
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.agentes-wrap .button:hover,
.agentes-wrap button:hover,
.agentes-wrap input[type="submit"]:hover {
	background: var(--agentes-accent-deep);
	border-color: var(--agentes-accent-deep);
	color: #fff;
}

.agentes-elegir__registro .button {
	background: transparent;
	border-color: var(--agentes-ink);
	color: var(--agentes-ink);
}

.agentes-elegir__registro .button:hover {
	background: var(--agentes-ink);
	border-color: var(--agentes-ink);
	color: #fff;
}

.agentes-wrap .button--secundario {
	background: transparent;
	border-color: var(--agentes-line);
	color: var(--agentes-ink);
}

.agentes-wrap .button--secundario:hover {
	border-color: var(--agentes-ink);
	background: transparent;
	color: var(--agentes-ink);
}

/* -----------------------------------------------------------------------
 * Formularios de datos (pasos del registro, alta de agente)
 * --------------------------------------------------------------------- */
.agentes-wrap form p {
	margin: 0 0 1.1rem;
}

.agentes-wrap form p label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 500;
	font-size: 0.9rem;
	color: var(--agentes-muted);
}

.agentes-wrap form p label input[type="checkbox"] {
	width: auto;
	margin-right: 0.5rem;
	vertical-align: middle;
}

/* -----------------------------------------------------------------------
 * Cajas de estado
 * --------------------------------------------------------------------- */
.agentes-errores {
	background: var(--agentes-danger-bg);
	border-left: 3px solid var(--agentes-danger);
	color: var(--agentes-danger);
	padding: 0.9rem 1.1rem;
	border-radius: 0 3px 3px 0;
	margin-bottom: 1.25rem;
}

.agentes-errores ul {
	margin: 0;
	padding-left: 1.2rem;
}

.agentes-texto-legal {
	max-height: 260px;
	overflow-y: auto;
	padding: 1rem 1.25rem;
	margin-bottom: 1.25rem;
	border: 1px solid var(--agentes-line);
	border-radius: 3px;
	background: var(--agentes-surface-alt);
	font-size: 0.92rem;
	line-height: 1.55;
}

.agentes-texto-legal p:first-child {
	margin-top: 0;
}

.agentes-texto-legal p:last-child {
	margin-bottom: 0;
}

.agentes-aviso-temporal {
	border-left: 3px solid var(--agentes-accent);
	border-radius: 0 3px 3px 0;
	padding: 1.1rem 1.25rem;
	margin-top: 1.5rem;
	background: var(--agentes-surface-alt);
}

.agentes-aviso-ok {
	background: var(--agentes-surface-alt);
	border-left: 3px solid var(--agentes-accent-deep);
	color: var(--agentes-accent-deep);
	padding: 0.9rem 1.1rem;
	border-radius: 0 3px 3px 0;
	margin-bottom: 1.25rem;
}

.agentes-aviso-ok p {
	margin: 0;
}

/* -----------------------------------------------------------------------
 * Cabecera del panel privado (título + cerrar sesión)
 * --------------------------------------------------------------------- */
.agentes-panel-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--agentes-line);
}

.agentes-panel-header h2 {
	margin: 0;
}

.agentes-cerrar-sesion {
	display: inline-block;
	padding: 0.5rem 1rem;
	border: 1px solid var(--agentes-line);
	border-radius: 3px;
	color: var(--agentes-muted);
	font-size: 0.85rem;
	font-weight: 500;
	text-decoration: none;
}

.agentes-cerrar-sesion:hover {
	border-color: var(--agentes-danger);
	color: var(--agentes-danger);
}

/* -----------------------------------------------------------------------
 * Navegación por pestañas del panel privado
 * --------------------------------------------------------------------- */
.agentes-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	border-bottom: 1px solid var(--agentes-line);
	margin: 1.25rem 0 0;
}

.agentes-tabs__link {
	display: inline-block;
	padding: 0.75rem 1.1rem;
	color: var(--agentes-muted);
	font-weight: 500;
	font-size: 0.95rem;
	text-decoration: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}

.agentes-tabs__link:hover {
	color: var(--agentes-ink);
}

.agentes-tabs__link--activa {
	color: var(--agentes-ink);
	font-weight: 600;
	border-bottom-color: var(--agentes-accent);
}

.agentes-panel-contenido {
	background: var(--agentes-surface);
	border: 1px solid var(--agentes-line);
	border-top: none;
	padding: 1.75rem;
}

.agentes-panel-contenido h3 {
	margin-top: 0;
}

/* -----------------------------------------------------------------------
 * Tarjetas de estadísticas (nº agentes/contactos/conversiones)
 * --------------------------------------------------------------------- */
.agentes-stats {
	display: flex;
	flex-wrap: wrap;
	margin-bottom: 1.75rem;
	border-top: 1px solid var(--agentes-line);
}

.agentes-stat {
	flex: 1 1 160px;
	padding: 1.1rem 1.25rem;
	border-bottom: 1px solid var(--agentes-line);
	border-left: 3px solid var(--agentes-accent);
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.agentes-stat__valor {
	font-family: var(--agentes-font-display);
	font-size: 2.1rem;
	font-weight: 600;
	color: var(--agentes-ink);
	line-height: 1;
}

.agentes-stat__etiqueta {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--agentes-ink);
}

.agentes-stat__nota {
	font-size: 0.78rem;
	color: var(--agentes-muted);
}

/* -----------------------------------------------------------------------
 * Pantalla de bienvenida del panel
 * --------------------------------------------------------------------- */
.agentes-bienvenida__tarjetas {
	display: flex;
	flex-wrap: wrap;
	gap: 1px;
	margin-top: 1.25rem;
	background: var(--agentes-line);
	border: 1px solid var(--agentes-line);
}

.agentes-tarjeta {
	flex: 1 1 180px;
	padding: 1.5rem 1.25rem;
	background: var(--agentes-surface);
	color: var(--agentes-ink);
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.agentes-tarjeta:hover {
	background: var(--agentes-ink);
	color: #fff;
}

.agentes-tabla--datos {
	max-width: 480px;
}

.agentes-tabla--datos th {
	width: 40%;
	background: var(--agentes-surface-alt);
	font-weight: 600;
	white-space: nowrap;
}

.agentes-nota {
	color: var(--agentes-muted);
	font-size: 0.9rem;
}

/* -----------------------------------------------------------------------
 * Tablas del panel privado (listado de agentes, etc.)
 * --------------------------------------------------------------------- */
.agentes-tabla {
	width: 100%;
	border-collapse: collapse;
	margin: 0.75rem 0 1.5rem;
	font-size: 0.9rem;
}

.agentes-tabla th,
.agentes-tabla td {
	padding: 0.65rem 0.75rem;
	border-bottom: 1px solid var(--agentes-line);
	text-align: left;
	vertical-align: middle;
}

.agentes-tabla th {
	background: var(--agentes-surface-alt);
	font-weight: 600;
	font-size: 0.85rem;
}

.agentes-tabla tbody tr:hover {
	background: var(--agentes-surface-alt);
}

/* -----------------------------------------------------------------------
 * Estado (activo/pausado/baja) — punto de color + texto, no insignia
 * -----------------------------------------------------------------------
 */
.agentes-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.15rem 0;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--agentes-ink);
}

.agentes-badge::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--agentes-muted);
	flex-shrink: 0;
}

.agentes-badge--activo::before {
	background: var(--agentes-accent-deep);
}

.agentes-badge--inactivo::before {
	background: var(--agentes-muted);
}

.agentes-badge--boton {
	border: none;
	background: none;
	cursor: pointer;
	font-family: inherit;
	padding: 0.15rem 0;
}

.agentes-badge--boton:hover {
	text-decoration: underline;
}

.agentes-accion-inline {
	display: inline-block;
	margin: 0 0.5rem 0 0;
}

.agentes-accion-link {
	background: none;
	border: none;
	padding: 0;
	color: var(--agentes-accent-deep);
	text-decoration: none;
	cursor: pointer;
	font-size: 0.85rem;
	font-family: inherit;
}

.agentes-accion-link:hover {
	text-decoration: underline;
}

.agentes-accion-link--borrar {
	color: var(--agentes-danger);
}

/* -----------------------------------------------------------------------
 * Responsive
 * --------------------------------------------------------------------- */
@media (max-width: 640px) {
	.agentes-wrap {
		margin: 1.25rem auto;
	}

	.agentes-progreso {
		gap: 0.35rem;
	}

	.agentes-progreso__etiqueta {
		font-size: 0.7rem;
	}

	.agentes-elegir__registro {
		border-left: none;
		border-top: 1px solid var(--agentes-line);
		padding-left: 0;
		margin-top: 1.5rem;
		padding-top: 1.5rem;
	}

	.agentes-elegir__login,
	.agentes-elegir__registro {
		padding-right: 0;
	}

	.agentes-panel-contenido {
		padding: 1.25rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.agentes-wrap * {
		transition: none !important;
	}
}
