/**
 * HMA Square Subscriptions - confirmation page styles.
 *
 * Scoped under .hma-confirmation to avoid theme conflicts.
 * Theme target: DARK variant, alineado con la identidad de feedbackflow360.com.
 *
 * Paleta tomada del sitio en vivo (no inventada):
 *   - Page bg   #001529  (background real del body del theme)
 *   - Card bg   #002A5D  (--primary-dark del theme)
 *   - Accent    #009AA6  (--primary-light del theme, teal de marca)
 *   - Enlaces   #4FB9C2 / #82CED3 (derivados del accent, ver tokens)
 *   - Texto     #f4f4f4 / blancos con alpha
 *
 * Para adaptar este archivo a otra web hermana solo hay que cambiar los
 * valores del bloque de tokens de abajo; ninguna regla usa colores de marca
 * escritos a mano (corregido el 2026-09-10: quedaban cinco de ChatFlow360).
 *
 * No frameworks, no JS, no external fonts. Mobile-first; 640px breakpoint.
 * Markup contract: ver templates/confirmation-{completed,failed-card,failed-other}.php
 */

/* -------------------------------------------------------------------------
 * Design tokens (scoped, no globales)
 * ------------------------------------------------------------------------- */
.hma-confirmation {
	--hma-c-page-bg:        #001529;
	--hma-c-card-bg:        #002A5D;
	--hma-c-card-border:    rgba(255, 255, 255, 0.08);
	--hma-c-text:           #ffffff;
	--hma-c-text-soft:      rgba(255, 255, 255, 0.7);
	--hma-c-text-muted:     rgba(255, 255, 255, 0.5);
	--hma-c-divider:        rgba(255, 255, 255, 0.12);

	--hma-c-accent:         #009AA6;
	--hma-c-accent-hover:   #007C86;
	--hma-c-accent-shadow:  rgba(0, 154, 166, 0.35);

	/* Variantes del acento. El theme no define un turquesa claro, así que el color
	   de enlace se deriva de --hma-c-accent aclarándolo hasta igualar la
	   legibilidad que tiene ChatFlow360 sobre su tarjeta (6.0:1 el enlace,
	   7.8:1 el hover). El acento puro da 4.1:1: no alcanza para texto chico. */
	--hma-c-accent-soft-bg:     rgba(0, 154, 166, 0.10);
	--hma-c-accent-soft-border: rgba(0, 154, 166, 0.28);
	--hma-c-link:               #4FB9C2;
	--hma-c-link-hover:         #82CED3;

	--hma-c-success:        #22c55e;
	--hma-c-success-soft:   rgba(34, 197, 94, 0.15);
	--hma-c-success-ring:   rgba(34, 197, 94, 0.22);

	--hma-c-error:          #ef4444;
	--hma-c-error-soft:     rgba(239, 68, 68, 0.15);
	--hma-c-error-ring:     rgba(239, 68, 68, 0.22);

	--hma-c-neutral:        rgba(255, 255, 255, 0.6);
	--hma-c-neutral-soft:   rgba(255, 255, 255, 0.08);
	--hma-c-neutral-ring:   rgba(255, 255, 255, 0.12);

	--hma-radius:           12px;
	--hma-radius-lg:        24px;

	--hma-shadow-card:
		0 1px 2px rgba(0, 0, 0, 0.25),
		0 8px 24px rgba(0, 0, 0, 0.35);

	--hma-shadow-btn:       0 4px 16px 0 var(--hma-c-accent-shadow);
}

/* -------------------------------------------------------------------------
 * Card container
 * ------------------------------------------------------------------------- */
.hma-confirmation {
	box-sizing: border-box;
	max-width: 640px;
	margin: 2rem auto;
	padding: 2.25rem 1.5rem;

	background-color: var(--hma-c-card-bg);
	border: 1px solid var(--hma-c-card-border);
	border-radius: var(--hma-radius-lg);
	box-shadow: var(--hma-shadow-card);

	color: var(--hma-c-text);
	font-family: inherit;
	line-height: 1.55;
	text-align: center;

	animation: hma-confirmation-fade-in 220ms ease-out both;
}

.hma-confirmation *,
.hma-confirmation *::before,
.hma-confirmation *::after {
	box-sizing: border-box;
}

@keyframes hma-confirmation-fade-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0);   }
}

@media (prefers-reduced-motion: reduce) {
	.hma-confirmation {
		animation: none;
	}
}

/* -------------------------------------------------------------------------
 * Icon (SVG circle + mark)
 * ------------------------------------------------------------------------- */
.hma-confirmation__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	width: 72px;
	height: 72px;
	margin: 0 auto 1.25rem;

	border-radius: 50%;
	background-color: var(--hma-c-neutral-soft);
	color: var(--hma-c-neutral);
}

.hma-confirmation__icon svg {
	display: block;
	width: 60%;
	height: 60%;
	overflow: visible;
}

.hma-confirmation__icon-ring {
	fill: none;
	stroke: currentColor;
	stroke-width: 3;
	opacity: 0.35;
}

.hma-confirmation__icon-mark {
	fill: none;
	stroke: currentColor;
	stroke-width: 5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Icon variants */
.hma-confirmation__icon--success {
	background-color: var(--hma-c-success-soft);
	color: var(--hma-c-success);
	box-shadow: 0 0 0 6px var(--hma-c-success-ring);
}

.hma-confirmation__icon--error {
	background-color: var(--hma-c-error-soft);
	color: var(--hma-c-error);
	box-shadow: 0 0 0 6px var(--hma-c-error-ring);
}

.hma-confirmation__icon--neutral {
	background-color: var(--hma-c-neutral-soft);
	color: var(--hma-c-neutral);
	box-shadow: 0 0 0 6px var(--hma-c-neutral-ring);
}

/* Subtle pop animation on icon (skipped under reduced motion) */
.hma-confirmation__icon {
	animation: hma-confirmation-pop 320ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
	animation-delay: 60ms;
}

@keyframes hma-confirmation-pop {
	from { opacity: 0; transform: scale(0.7); }
	to   { opacity: 1; transform: scale(1);   }
}

@media (prefers-reduced-motion: reduce) {
	.hma-confirmation__icon {
		animation: none;
	}
}

/* -------------------------------------------------------------------------
 * Typography
 * ------------------------------------------------------------------------- */
.hma-confirmation__title {
	margin: 0 0 0.5rem;
	color: var(--hma-c-text);
	font-size: 1.625rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1.2;
}

.hma-confirmation__title-mark {
	display: inline-block;
	margin-left: 0.35em;
	color: var(--hma-c-success);
	font-weight: 700;
}

.hma-confirmation__title-mark--error {
	color: var(--hma-c-error);
}

.hma-confirmation__subtitle {
	margin: 0 0 1rem;
	color: var(--hma-c-text-soft);
	font-size: 1.0625rem;
	font-weight: 400;
}

.hma-confirmation__email-destination {
	margin: 1.25rem auto;
	padding: 0.875rem 1.25rem;
	max-width: 52ch;

	background-color: var(--hma-c-accent-soft-bg);
	border: 1px solid var(--hma-c-accent-soft-border);
	border-radius: var(--hma-radius);

	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
}

.hma-confirmation__email-label {
	color: var(--hma-c-text-muted);
	font-size: 0.8125rem;
	letter-spacing: 0.01em;
}

.hma-confirmation__email {
	color: var(--hma-c-text);
	font-weight: 600;
	font-size: 1.0625rem;
	word-break: break-word;
}

.hma-confirmation__ttl {
	margin: 0 auto 1rem;
	max-width: 52ch;
	color: var(--hma-c-text-muted);
	font-size: 0.8125rem;
	line-height: 1.5;
}

.hma-confirmation__message {
	margin: 0 auto 0.75rem;
	max-width: 52ch;
	color: var(--hma-c-text-soft);
	font-size: 1rem;
}

.hma-confirmation__message strong {
	color: var(--hma-c-text);
	font-weight: 700;
}

.hma-confirmation__highlight {
	color: var(--hma-c-text);
	font-weight: 700;
}

.hma-confirmation__detail {
	margin: 1.25rem auto 0;
	max-width: 52ch;
	color: var(--hma-c-text-muted);
	font-size: 0.875rem;
	line-height: 1.5;
}

.hma-confirmation__support-link {
	color: var(--hma-c-link);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	word-break: break-word;
}

.hma-confirmation__support-link:hover,
.hma-confirmation__support-link:focus-visible {
	color: var(--hma-c-link-hover);
	text-decoration-thickness: 2px;
}

.hma-confirmation__support-link:focus-visible {
	outline: 2px solid var(--hma-c-accent);
	outline-offset: 2px;
	border-radius: 2px;
}

/* -------------------------------------------------------------------------
 * Actions / button
 * ------------------------------------------------------------------------- */
.hma-confirmation__actions {
	margin: 1.75rem 0 0;
}

.hma-confirmation__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	min-height: 48px;
	padding: 16px 32px;

	background-color: var(--hma-c-accent);
	color: #ffffff;
	border: 1px solid transparent;
	border-radius: var(--hma-radius);
	box-shadow: var(--hma-shadow-btn);

	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;

	transition:
		background-color 160ms ease,
		box-shadow 160ms ease,
		transform 120ms ease;
}

.hma-confirmation__btn:hover,
.hma-confirmation__btn:focus-visible {
	background-color: var(--hma-c-accent-hover);
	color: #ffffff;
	box-shadow: 0 6px 24px 0 var(--hma-c-accent-shadow);
	transform: translateY(-1px);
}

.hma-confirmation__btn:focus-visible {
	outline: 2px solid var(--hma-c-accent);
	outline-offset: 3px;
}

.hma-confirmation__btn:active {
	transform: translateY(0);
	box-shadow: 0 2px 10px 0 var(--hma-c-accent-shadow);
}

.hma-confirmation__btn-arrow {
	display: inline-block;
	margin-left: 0.5rem;
	transition: transform 160ms ease;
}

.hma-confirmation__btn:hover .hma-confirmation__btn-arrow,
.hma-confirmation__btn:focus-visible .hma-confirmation__btn-arrow {
	transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
	.hma-confirmation__btn-arrow {
		transition: none;
	}
}

/* -------------------------------------------------------------------------
 * Countdown (completed only, when $signup_url is present)
 * ------------------------------------------------------------------------- */
.hma-confirmation__countdown-block {
	margin-top: 1.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--hma-c-divider);
}

.hma-confirmation__countdown-line {
	margin: 0 0 1rem;
	color: var(--hma-c-text-soft);
	font-size: 0.9375rem;
}

.hma-confirmation__countdown {
	display: inline-block;
	min-width: 1.5ch;
	padding: 0 0.15em;

	color: var(--hma-c-link);
	font-size: 1.5rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1;
	line-height: 1;
	vertical-align: baseline;
}

/* -------------------------------------------------------------------------
 * Variant tints (very subtle border/halo to reinforce state)
 * ------------------------------------------------------------------------- */
.hma-confirmation--completed {
	border-color: rgba(34, 197, 94, 0.30);
}

.hma-confirmation--failed-card {
	border-color: rgba(239, 68, 68, 0.30);
}

.hma-confirmation--failed-other {
	border-color: var(--hma-c-card-border);
}

/* -------------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------------- */
@media (min-width: 640px) {
	.hma-confirmation {
		margin: 3rem auto;
		padding: 3rem 2.75rem;
	}

	.hma-confirmation__icon {
		width: 80px;
		height: 80px;
		margin-bottom: 1.5rem;
	}

	.hma-confirmation__title {
		font-size: 2rem;
	}

	.hma-confirmation__subtitle {
		font-size: 1.125rem;
	}

	.hma-confirmation__countdown {
		font-size: 1.75rem;
	}
}

@media (max-width: 480px) {
	.hma-confirmation {
		margin: 1.25rem auto;
		padding: 1.75rem 1.25rem;
		border-radius: 18px;
	}

	.hma-confirmation__title {
		font-size: 1.375rem;
	}

	.hma-confirmation__btn {
		width: 100%;
		padding: 16px 24px;
	}
}

/* -------------------------------------------------------------------------
 * High-contrast / forced-colors safety net
 * ------------------------------------------------------------------------- */
@media (forced-colors: active) {
	.hma-confirmation {
		border: 1px solid CanvasText;
	}

	.hma-confirmation__btn {
		border-color: ButtonText;
	}

	.hma-confirmation__icon {
		box-shadow: none;
	}
}
