/* ==========================================================================
   CALCULADORA DE ENERGÍA PERSONAL DEL DÍA
   Todas las clases están prefijadas con "cepd-" para no chocar jamás
   con el CSS del tema, de Elementor ni de otros shortcodes de la página.
   Paleta (fija, no modificar):
     #EEAAE9  acento terciario / detalles
     #8c6ac9  acento secundario / hover
     #000000  texto principal
     #8A71C2  acento principal / botones / bordes
     #FFFCFF  fondo principal
     #C9BFE2  fondo alternativo (tarjetas)
   Tipografía: Roboto, 18px–22px en el cuerpo, 72px solo en el número EPD.
   ========================================================================== */

.cepd-wrap {
	--cepd-rosa: #EEAAE9;
	--cepd-purpura-vibrante: #8c6ac9;
	--cepd-negro: #000000;
	--cepd-purpura-medio: #8A71C2;
	--cepd-fondo: #FFFCFF;
	--cepd-fondo-alt: #C9BFE2;

	box-sizing: border-box;
	max-width: 780px;
	margin: 0 auto;
	padding: 28px 20px 34px;
	background: var(--cepd-fondo);
	border-radius: 28px;
	position: relative;
	overflow: hidden;
	font-family: 'Roboto', Arial, sans-serif;
	color: var(--cepd-negro);
	isolation: isolate;
	box-shadow: 0 18px 50px -18px rgba(138, 113, 194, 0.35);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

.cepd-wrap * {
	box-sizing: border-box;
}

/* Textura numerológica de fondo, muy sutil: constelación de números fantasma. */
.cepd-orbita-decorativa {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-image:
		radial-gradient(circle at 12% 20%, rgba(238, 170, 233, 0.18) 0, transparent 42%),
		radial-gradient(circle at 88% 78%, rgba(138, 113, 194, 0.16) 0, transparent 46%),
		repeating-linear-gradient(120deg, rgba(140, 106, 201, 0.05) 0 2px, transparent 2px 42px);
}

/* --------------------------------------------------------------------
   Barra superior: imagen izquierda + título/subtítulo + imagen derecha
   -------------------------------------------------------------------- */
.cepd-topbar {
	display: grid;
	grid-template-columns: 72px 1fr 72px;
	align-items: center;
	gap: 14px;
	margin-bottom: 18px;
}

.cepd-topbar--sin-imagenes {
	grid-template-columns: 1fr;
	justify-items: center;
}

.cepd-img-link {
	display: block;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	overflow: hidden;
	border: 2px solid var(--cepd-rosa);
	transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
	justify-self: center;
}

.cepd-img-link:hover,
.cepd-img-link:focus-visible {
	transform: translateY(-3px) scale(1.04);
	border-color: var(--cepd-purpura-vibrante);
	box-shadow: 0 8px 18px -6px rgba(138, 113, 194, 0.55);
}

.cepd-img-link img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cepd-heading {
	text-align: center;
}

.cepd-title {
	margin: 0 0 4px;
	color: var(--cepd-purpura-medio);
	font-weight: 700;
	font-size: clamp(22px, 4vw, 30px);
	letter-spacing: 0.2px;
}

.cepd-subtitle {
	margin: 0;
	color: var(--cepd-negro);
	font-size: 18px;
	font-weight: 400;
	opacity: 0.85;
}

/* --------------------------------------------------------------------
   Tarjeta principal
   -------------------------------------------------------------------- */
.cepd-card {
	background: var(--cepd-fondo);
	border: 1px solid rgba(138, 113, 194, 0.25);
	border-radius: 22px;
	padding: 26px 22px;
}

.cepd-label {
	display: block;
	font-size: 18px;
	font-weight: 500;
	margin-bottom: 8px;
	color: var(--cepd-negro);
}

.cepd-form-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.cepd-input {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 52px;
	font-family: inherit;
	font-size: 18px;
	line-height: 1;
	padding: 0 44px 0 14px;
	border: 2px solid var(--cepd-purpura-medio);
	border-radius: 12px;
	background: var(--cepd-fondo);
	color: var(--cepd-negro);
	position: relative;
	z-index: 0;
}

/* En Chrome/Android el indicador nativo del calendario queda a la derecha;
   lo dejamos visible pero transparente y ponemos nuestro propio ícono encima,
   así el control se ve idéntico en cualquier navegador o dispositivo. */
.cepd-input::-webkit-calendar-picker-indicator {
	position: absolute;
	right: 0;
	width: 44px;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.cepd-date-field {
	position: relative;
	flex: 1 1 220px;
}

.cepd-date-icono {
	position: absolute;
	top: 50%;
	right: 14px;
	transform: translateY(-50%);
	font-size: 20px;
	line-height: 1;
	pointer-events: none;
	z-index: 2;
}

.cepd-date-placeholder {
	position: absolute;
	top: 50%;
	left: 14px;
	transform: translateY(-50%);
	font-size: 18px;
	color: var(--cepd-negro);
	opacity: 0.45;
	pointer-events: none;
	z-index: 2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: calc(100% - 58px);
}

.cepd-date-field.cepd-tiene-valor .cepd-date-placeholder {
	display: none;
}

.cepd-input:focus-visible {
	outline: 3px solid var(--cepd-rosa);
	outline-offset: 1px;
}

.cepd-btn {
	flex: 1 1 220px;
	font-family: inherit;
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
	color: var(--cepd-fondo);
	background: var(--cepd-purpura-medio);
	border: none;
	border-radius: 12px;
	height: 52px;
	padding: 0 22px;
	white-space: nowrap;
	cursor: pointer;
	position: relative;
	transition: background-color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
	animation: cepd-pulso 2.6s ease-in-out infinite;
}

.cepd-btn-texto {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	white-space: nowrap;
}

.cepd-btn:hover,
.cepd-btn:focus-visible {
	background: var(--cepd-purpura-vibrante);
	transform: translateY(-2px);
	box-shadow: 0 10px 22px -8px rgba(140, 106, 201, 0.6);
}

.cepd-btn:active {
	transform: translateY(0);
}

@keyframes cepd-pulso {
	0%, 100% { box-shadow: 0 0 0 0 rgba(138, 113, 194, 0.45); }
	50% { box-shadow: 0 0 0 10px rgba(138, 113, 194, 0); }
}

.cepd-form-error {
	color: #7a1f5c;
	background: #fdeefc;
	border-left: 4px solid var(--cepd-rosa);
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 18px;
	margin: 14px 0 0;
}

/* --------------------------------------------------------------------
   Loading / "sintonización cósmica"
   -------------------------------------------------------------------- */
.cepd-loading {
	text-align: center;
	padding: 30px 10px;
}

.cepd-spinner {
	display: inline-flex;
	gap: 8px;
	margin-bottom: 14px;
}

.cepd-spinner span {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--cepd-purpura-medio);
	animation: cepd-rebote 1s ease-in-out infinite;
}

.cepd-spinner span:nth-child(2) { background: var(--cepd-purpura-vibrante); animation-delay: 0.15s; }
.cepd-spinner span:nth-child(3) { background: var(--cepd-rosa); animation-delay: 0.3s; }

@keyframes cepd-rebote {
	0%, 80%, 100% { transform: translateY(0); opacity: 0.6; }
	40% { transform: translateY(-10px); opacity: 1; }
}

.cepd-loading-texto {
	font-size: 18px;
	color: var(--cepd-purpura-medio);
	font-weight: 500;
	margin: 0;
}

/* --------------------------------------------------------------------
   Resultado
   -------------------------------------------------------------------- */
.cepd-result {
	text-align: center;
	animation: cepd-aparecer 0.5s ease both;
}

@keyframes cepd-aparecer {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: translateY(0); }
}

.cepd-orbit {
	position: relative;
	width: 190px;
	height: 190px;
	margin: 8px auto 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
}

.cepd-orbit-ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	padding: 6px;
	background: conic-gradient(from 0deg, var(--cepd-purpura-medio), var(--cepd-rosa), var(--cepd-purpura-vibrante), var(--cepd-purpura-medio));
	-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 6px));
	mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 6px));
	animation: cepd-girar 6s linear infinite;
}

@keyframes cepd-girar {
	to { transform: rotate(360deg); }
}

.cepd-number {
	font-size: 72px;
	line-height: 1;
	font-weight: 900;
	color: var(--cepd-negro);
}

.cepd-number-label {
	font-size: 18px;
	font-weight: 500;
	color: var(--cepd-purpura-medio);
	margin-top: 4px;
}

.cepd-metrics {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	max-width: 420px;
	margin: 0 auto 20px;
}

.cepd-metric-card {
	background: var(--cepd-fondo-alt);
	border-radius: 14px;
	padding: 12px 10px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cepd-metric-valor {
	font-size: 22px;
	font-weight: 700;
	color: var(--cepd-negro);
}

.cepd-metric-nombre {
	font-size: 18px;
	color: var(--cepd-negro);
	opacity: 0.85;
}

.cepd-message-box {
	text-align: left;
	background: var(--cepd-fondo);
	border-left: 6px solid var(--cepd-purpura-vibrante);
	border-radius: 10px;
	padding: 16px 18px;
	margin: 0 auto 20px;
	max-width: 560px;
	box-shadow: 0 6px 20px -12px rgba(0, 0, 0, 0.25);
}

.cepd-message {
	margin: 0;
	font-size: 20px;
	line-height: 1.55;
	color: var(--cepd-negro);
}

.cepd-share-btn {
	font-family: inherit;
	font-size: 18px;
	font-weight: 700;
	background: var(--cepd-rosa);
	color: var(--cepd-negro);
	border: none;
	border-radius: 12px;
	padding: 12px 20px;
	cursor: pointer;
	min-height: 46px;
	transition: transform 0.15s ease, box-shadow 0.25s ease;
}

.cepd-share-btn:hover,
.cepd-share-btn:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 8px 18px -8px rgba(238, 170, 233, 0.7);
}

.cepd-share-feedback {
	font-size: 18px;
	color: var(--cepd-purpura-vibrante);
	min-height: 22px;
	margin: 8px 0 0;
}

.cepd-noscript {
	font-size: 18px;
	text-align: center;
}

.cepd-seo-texto {
	font-size: 18px;
	line-height: 1.6;
	color: var(--cepd-negro);
	opacity: 0.82;
	margin: 24px auto 0;
	max-width: 640px;
	text-align: center;
}

.cepd-footer-atribucion {
	text-align: center;
	font-size: 18px;
	color: var(--cepd-negro);
	opacity: 0.6;
	margin: 14px 0 0;
}

/* --------------------------------------------------------------------
   Responsive: 100% adaptable a todos los dispositivos
   -------------------------------------------------------------------- */
@media (max-width: 640px) {
	.cepd-wrap {
		padding: 20px 14px 24px;
		border-radius: 20px;
	}

	.cepd-topbar {
		grid-template-columns: 48px 1fr 48px;
		gap: 8px;
		margin-bottom: 12px;
	}

	.cepd-img-link {
		width: 48px;
		height: 48px;
	}

	.cepd-title {
		font-size: 22px;
	}

	.cepd-subtitle {
		font-size: 18px;
	}

	.cepd-card {
		padding: 16px 14px;
	}

	.cepd-label {
		margin-bottom: 6px;
	}

	.cepd-form-row {
		flex-direction: column;
		gap: 10px;
	}

	.cepd-date-field,
	.cepd-btn {
		width: 100%;
		flex: none;
	}

	.cepd-input,
	.cepd-btn {
		height: 50px;
	}

	.cepd-orbit {
		width: 150px;
		height: 150px;
	}

	.cepd-number {
		font-size: 54px;
	}

	.cepd-metrics {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 380px) {
	.cepd-topbar {
		grid-template-columns: 1fr;
		justify-items: center;
	}

	.cepd-img-link.cepd-img-left { order: 1; }
	.cepd-heading { order: 0; }
	.cepd-img-link.cepd-img-right { order: 2; }
}

/* Respeta la preferencia del usuario de reducir el movimiento. */
@media (prefers-reduced-motion: reduce) {
	.cepd-btn,
	.cepd-orbit-ring,
	.cepd-spinner span {
		animation: none !important;
	}

	.cepd-result {
		animation: none !important;
	}
}

/* --------------------------------------------------------------------
   Panel de administración (reutiliza fuente/color de marca)
   -------------------------------------------------------------------- */
.cepd-admin-wrap h2 {
	color: #8A71C2;
}
