/* ================================================================
   Aura Press — Funnel v2.0  |  aura-scan.css
   ================================================================ */

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

.apf-root {
	--apf-pink:      #d16b7b;
	--apf-pink-soft: #f7e6ea;
	--apf-pink-mid:  #fcdce3;
	--apf-ink:       #111111;
	--apf-muted:     #888888;
	--apf-bg:        #f5f5f5;
	--apf-white:     #ffffff;
	--apf-line:      #e8e8e8;
	--apf-font:      'Poppins', 'Montserrat', system-ui, sans-serif;
	--apf-safe-t:    env(safe-area-inset-top, 0px);
	--apf-safe-b:    env(safe-area-inset-bottom, 0px);

	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	font-family: var(--apf-font);
	color: var(--apf-ink);
	background: var(--apf-bg);
	-webkit-tap-highlight-color: transparent;
	user-select: none;
	-webkit-user-select: none;
}

/* ── Phase system ─────────────────────────────────────────────── */
.apf-phase {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22,1,0.36,1);
	transform: translateY(12px);
}

.apf-phase.is-active {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

.apf-phase.is-exit {
	opacity: 0;
	transform: translateY(-12px);
	pointer-events: none;
}

/* ── Brand bar ────────────────────────────────────────────────── */
.apf-brand {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: calc(14px + var(--apf-safe-t)) 18px 0;
	flex-shrink: 0;
}

.apf-brand__back {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px; height: 36px;
	border-radius: 50%;
	background: rgba(255,255,255,0.7);
	color: var(--apf-ink);
	text-decoration: none;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.apf-brand__name {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--apf-muted);
}

.apf-brand--light .apf-brand__name { color: rgba(255,255,255,0.8); }
.apf-brand--light .apf-brand__back {
	background: rgba(255,255,255,0.2);
	color: #fff;
}

.apf-brand__spacer { width: 36px; }

/* ================================================================
   PHASE 1 — SCAN
   ================================================================ */
.apf-phase--scan {
	background:
		radial-gradient(130% 80% at 50% -5%, rgba(209,107,123,0.18) 0%, transparent 55%),
		radial-gradient(80% 55% at 95% 95%,  rgba(252,220,227,0.6)  0%, transparent 50%),
		var(--apf-bg);
}

.apf-scan-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 0 24px calc(24px + var(--apf-safe-b));
	gap: clamp(12px, 2.8vh, 22px);
	text-align: center;
}

.apf-scan-kicker {
	margin: 0;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--apf-pink);
}

.apf-scan-title {
	margin: 0;
	font-size: clamp(1.75rem, 7.5vw, 2.4rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.025em;
	color: var(--apf-ink);
}

.apf-scan-sub {
	margin: 0;
	font-size: clamp(0.84rem, 3.4vw, 0.95rem);
	color: var(--apf-muted);
	max-width: 28ch;
	line-height: 1.55;
}

/* ── Hold orb ─────────────────────────────────────────────────── */
.apf-orb-wrap {
	position: relative;
	width: min(56vw, 210px);
	aspect-ratio: 1;
	display: grid;
	place-items: center;
	touch-action: none;
	flex-shrink: 0;
}

.apf-orb-ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 1.5px solid rgba(209,107,123,0.22);
	animation: apf-ring-pulse 3.2s ease-in-out infinite;
}
.apf-orb-ring--outer {
	inset: -12px;
	border-color: rgba(209,107,123,0.1);
	animation-delay: -1.6s;
}

.apf-orb {
	position: relative;
	width: 72%;
	aspect-ratio: 1;
	border-radius: 50%;
	border: none;
	padding: 0;
	cursor: pointer;
	outline: none;
	touch-action: none;
	-webkit-tap-highlight-color: transparent;
	background:
		radial-gradient(circle at 32% 26%, #fff 0%, transparent 44%),
		radial-gradient(circle at 72% 78%, rgba(209,107,123,0.35) 0%, transparent 55%),
		linear-gradient(145deg, #fff5f7 0%, #f7e6ea 45%, #f0d4db 100%);
	box-shadow:
		0 0 0 1px rgba(209,107,123,0.14) inset,
		0 18px 48px rgba(209,107,123,0.22),
		0 4px 14px rgba(17,17,17,0.06);
	animation: apf-breathe 3.4s ease-in-out infinite;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Conic fill that grows as user holds */
.apf-orb-inner {
	position: absolute;
	inset: 10%;
	border-radius: 50%;
	background: conic-gradient(
		from 200deg,
		rgba(209,107,123,0.06),
		rgba(209,107,123,0.65),
		rgba(252,220,227,0.95),
		rgba(209,107,123,0.5),
		rgba(209,107,123,0.06)
	);
	opacity: 0.5;
	transform: scale(var(--apf-fill, 0.15));
	transition: transform 0.05s linear, opacity 0.2s ease;
}

/* Glass center */
.apf-orb::after {
	content: '';
	position: absolute;
	inset: 24%;
	border-radius: 50%;
	background: radial-gradient(circle at 38% 34%, #fff, #f7e6ea 70%);
	box-shadow: 0 0 20px rgba(209,107,123,0.14);
}

.apf-orb-label {
	position: relative;
	z-index: 2;
	pointer-events: none;
	font-size: clamp(0.72rem, 3vw, 0.82rem);
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--apf-pink);
}

.apf-orb.is-holding {
	animation: none;
	transform: scale(1.06);
	box-shadow:
		0 0 0 1px rgba(209,107,123,0.22) inset,
		0 20px 52px rgba(209,107,123,0.32),
		0 0 0 10px rgba(209,107,123,0.09);
}
.apf-orb.is-holding .apf-orb-inner { opacity: 0.92; }

.apf-orb.is-complete { animation: apf-pulse-done 0.5s ease both; }

.apf-scan-hint {
	margin: 0;
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--apf-muted);
	min-height: 1.4em;
}

.apf-progress-track {
	width: min(50vw, 190px);
	height: 3px;
	border-radius: 999px;
	background: var(--apf-pink-mid);
	overflow: hidden;
	flex-shrink: 0;
}
.apf-progress-fill {
	height: 100%;
	width: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--apf-pink), #e8919d);
	transform: scaleX(0);
	transform-origin: left;
	will-change: transform;
}

.apf-already-note {
	font-size: 0.75rem;
	color: var(--apf-muted);
	margin: 0;
}

/* ================================================================
   PHASE 2 — RESULT
   ================================================================ */
.apf-phase--result {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

/* Full-bleed aura gradient background */
.apf-result-bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	opacity: 0;
	transition: opacity 0.7s ease;
	background: var(--apf-aura-gradient, linear-gradient(145deg, #f7e6ea, #d16b7b));
}
.apf-phase--result.is-active .apf-result-bg { opacity: 1; }

.apf-phase--result .apf-brand { position: relative; z-index: 2; }

.apf-result-body {
	position: relative;
	z-index: 2;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 10px 24px calc(32px + var(--apf-safe-b));
	gap: clamp(10px, 2.4vh, 18px);
	text-align: center;
}

.apf-result-kicker {
	margin: 0;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: rgba(255,255,255,0.75);
}

.apf-result-swatch {
	width: clamp(52px, 14vw, 64px);
	height: clamp(52px, 14vw, 64px);
	border-radius: 50%;
	border: 2.5px solid rgba(255,255,255,0.7);
	box-shadow: 0 8px 28px rgba(0,0,0,0.14);
	background: rgba(255,255,255,0.3);
	backdrop-filter: blur(8px);
	flex-shrink: 0;
	animation: apf-swatch-pop 0.55s cubic-bezier(0.34,1.56,0.64,1) both;
}

.apf-result-title {
	margin: 0;
	font-size: clamp(1.8rem, 7.5vw, 2.6rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.025em;
	color: #fff;
	text-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.apf-result-desc {
	margin: 0;
	font-size: clamp(0.88rem, 3.4vw, 0.96rem);
	line-height: 1.55;
	color: rgba(255,255,255,0.88);
	max-width: 30ch;
}

/* ── Featured product card ────────────────────────────────────── */
.apf-featured-product {
	width: 100%;
	max-width: 320px;
}

.apf-featured-label {
	margin: 0 0 8px;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: rgba(255,255,255,0.7);
}

.apf-featured-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 14px;
	background: rgba(255,255,255,0.92);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-radius: 16px;
	border: 1px solid rgba(255,255,255,0.6);
	text-decoration: none;
	color: var(--apf-ink);
	box-shadow: 0 8px 32px rgba(0,0,0,0.1);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.apf-featured-card:active { transform: scale(0.98); }

.apf-featured-img {
	width: 60px; height: 60px;
	border-radius: 10px;
	object-fit: cover;
	background: var(--apf-pink-soft);
	flex-shrink: 0;
}

.apf-featured-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 3px;
	text-align: left;
}

.apf-featured-name {
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.25;
}

.apf-featured-price {
	font-size: 0.82rem;
	color: var(--apf-pink);
	font-weight: 600;
}

.apf-featured-arrow {
	font-size: 1.1rem;
	color: var(--apf-muted);
	flex-shrink: 0;
}

/* ── Result action buttons ────────────────────────────────────── */
.apf-result-actions {
	width: 100%;
	max-width: 320px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Shared button styles */
.apf-btn {
	appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 52px;
	padding: 14px 18px;
	border-radius: 6px;
	border: 1.5px solid transparent;
	font-family: var(--apf-font);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.18s ease, opacity 0.18s ease;
	-webkit-tap-highlight-color: transparent;
}
.apf-btn:active { transform: scale(0.975); }

.apf-btn--primary {
	background: #111;
	color: #fff;
	border-color: #111;
}
.apf-btn--ghost {
	background: rgba(255,255,255,0.88);
	color: var(--apf-ink);
	border-color: rgba(255,255,255,0.5);
	backdrop-filter: blur(8px);
}

/* ── Keyframes ────────────────────────────────────────────────── */
@keyframes apf-breathe {
	0%, 100% { transform: scale(1); }
	50%       { transform: scale(1.042); }
}
@keyframes apf-ring-pulse {
	0%, 100% { transform: scale(1);    opacity: 0.7; }
	50%       { transform: scale(1.05); opacity: 1;   }
}
@keyframes apf-pulse-done {
	0%  { transform: scale(1); }
	40% { transform: scale(1.1); }
	100%{ transform: scale(1); }
}
@keyframes apf-swatch-pop {
	from { transform: scale(0); opacity: 0; }
	to   { transform: scale(1); opacity: 1; }
}

/* ── Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.apf-orb, .apf-orb-ring, .apf-orb-ring--outer, .apf-result-swatch { animation: none !important; }
	.apf-phase { transition: opacity 0.2s ease; }
}

/* ── Short screens ────────────────────────────────────────────── */
@media (max-height: 680px) {
	.apf-orb-wrap { width: min(44vw, 160px); }
	.apf-scan-body { gap: 10px; }
}
@media (max-height: 560px) {
	.apf-orb-wrap { width: min(36vw, 130px); }
	.apf-scan-title { font-size: 1.5rem; }
}

/* ── Fix phase bleed-through behind swipe cards ───────────────── */
.apf-phase.is-exit {
	opacity: 0 !important;
	pointer-events: none !important;
	z-index: 0 !important;
	visibility: hidden;
}

.apf-phase--swipe.is-active {
	z-index: 10;
}

.apf-phase--result.is-active {
	z-index: 10;
}

.apf-phase--scan.is-active {
	z-index: 10;
}

/* ── Hide AURA20 coupon code from cart display ────────────────── */
.cart-discount.coupon-aura20 th::after {
	content: ' — Aura Loyalty Discount';
}
/* If WC shows the code in checkout order summary, hide it */
.woocommerce-checkout .coupon-aura20 .woocommerce-Price-amount + * {
	display: none;
}

/* ================================================================
   TEXT READABILITY FIXES
   ================================================================ */

/* ── Scan screen: always dark text on light background ─────────── */
.apf-phase--scan {
	color: var(--apf-ink);
}
.apf-scan-title {
	color: #111111 !important;
}
.apf-scan-sub {
	color: #555555 !important;
}
.apf-scan-hint {
	color: #777777 !important;
}
.apf-scan-kicker {
	color: var(--apf-pink) !important;
}

/* ── Result screen: dark overlay behind text for any aura color ── */
/* Some auras are light (Pearl Goddess = white), making white text unreadable */
.apf-result-body {
	position: relative;
	z-index: 2;
}

/* Semi-dark gradient overlay sits between bg and text */
.apf-phase--result::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.45) 0%,
		rgba(0, 0, 0, 0.15) 45%,
		transparent 75%
	);
	pointer-events: none;
}

/* Ensure result text is always white + shadow for readability */
.apf-result-kicker { color: rgba(255,255,255,0.9) !important; }
.apf-result-title  {
	color: #ffffff !important;
	text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.apf-result-desc   {
	color: rgba(255,255,255,0.92) !important;
	text-shadow: 0 1px 8px rgba(0,0,0,0.2);
}
.apf-featured-label { color: rgba(255,255,255,0.85) !important; }

/* Featured product card — always white bg with dark text */
.apf-featured-card {
	background: rgba(255,255,255,0.96) !important;
	color: #111 !important;
}
.apf-featured-name  { color: #111111 !important; }
.apf-featured-price { color: var(--apf-pink) !important; }

/* Result action buttons always readable */
.apf-btn--ghost {
	color: #111111 !important;
	background: rgba(255,255,255,0.92) !important;
}

/* ── Swipe screen: dark text on light grey background ──────────── */
.apf-phase--swipe {
	color: #111111;
}
.apf-swipe-kicker { color: var(--apf-pink) !important; }
.apf-swipe-meta   { color: #555555 !important; }
.apf-discount-banner__text { color: var(--apf-pink) !important; }
.apf-card__name   { color: #111111 !important; }
.apf-card__price  { color: var(--apf-pink) !important; }
