/**
 * WEX Lucky Wheel — frontend styles
 * Matched to weddingexpo.vn: brand red #E84430, warm cream atmosphere, Bricolage Grotesque.
 */

.wex-lw {
	--wex-brand: #e84430;
	--wex-brand-dark: #d03d34;
	--wex-text: #1a1a1a;
	--wex-muted: #54595f;
	--wex-cream: #fdf9f6;
	--wex-peach: #ffebe3;
	--wex-blush: #f8dcc4;
	--wex-gold: #d4af37;
	--wex-surface: #ffffff;
	--wex-radius: 16px;
	--wex-radius-lg: 24px;
	--wex-font: "Bricolage Grotesque", system-ui, sans-serif;

	position: relative;
	isolation: isolate;
	max-width: 480px;
	margin: 0 auto;
	padding: 28px 20px 36px;
	font-family: var(--wex-font);
	color: var(--wex-text);
	box-sizing: border-box;
}

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

.wex-lw__atmosphere {
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: var(--wex-radius-lg);
	background:
		radial-gradient(ellipse 120% 80% at 10% 0%, var(--wex-peach) 0%, transparent 55%),
		radial-gradient(ellipse 100% 70% at 100% 100%, var(--wex-blush) 0%, transparent 50%),
		linear-gradient(165deg, var(--wex-cream) 0%, #fffaf5 55%, var(--wex-peach) 100%);
}

.wex-lw__brand {
	margin: 0 0 8px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wex-brand);
}

.wex-lw__title {
	margin: 0 0 8px;
	font-size: clamp(1.65rem, 5vw, 2rem);
	font-weight: 700;
	line-height: 1.2;
	color: var(--wex-text);
}

.wex-lw__subtitle {
	margin: 0 0 24px;
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--wex-muted);
}

.wex-lw__form-panel[hidden],
.wex-lw__wheel-panel[hidden] {
	display: none;
}

.wex-lw__form {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.wex-lw__label {
	margin-top: 10px;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--wex-text);
}

.wex-lw__input {
	width: 100%;
	padding: 14px 16px;
	border: 1px solid #e2c1a4;
	border-radius: var(--wex-radius);
	background: var(--wex-surface);
	font-family: inherit;
	font-size: 1rem;
	color: var(--wex-text);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wex-lw__input::placeholder {
	color: #a89a90;
}

.wex-lw__input:focus {
	outline: none;
	border-color: var(--wex-brand);
	box-shadow: 0 0 0 3px rgba(232, 68, 48, 0.18);
}

.wex-lw__error {
	margin: 12px 0 0;
	padding: 12px 14px;
	border-radius: var(--wex-radius);
	background: #fdf2f1;
	color: var(--wex-brand-dark);
	font-size: 0.9rem;
	line-height: 1.4;
}

.wex-lw__error[hidden] {
	display: none;
}

.wex-lw__cta {
	margin-top: 18px;
	width: 100%;
	padding: 16px 20px;
	border: none;
	border-radius: var(--wex-radius);
	background: var(--wex-brand);
	color: #fff;
	font-family: inherit;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}

.wex-lw__cta:hover:not(:disabled) {
	background: var(--wex-brand-dark);
}

.wex-lw__cta:active:not(:disabled) {
	transform: scale(0.98);
}

.wex-lw__cta:disabled {
	opacity: 0.7;
	cursor: wait;
}

.wex-lw__cta--secondary {
	background: var(--wex-text);
}

.wex-lw__cta--secondary:hover:not(:disabled) {
	background: #2e2e2e;
}

/* Wheel */

.wex-lw__wheel-wrap {
	position: relative;
	width: min(320px, 86vw);
	margin: 28px auto 8px;
	aspect-ratio: 1;
}

.wex-lw__pointer {
	position: absolute;
	top: -6px;
	left: 50%;
	z-index: 3;
	width: 0;
	height: 0;
	border-left: 12px solid transparent;
	border-right: 12px solid transparent;
	border-top: 28px solid var(--wex-brand);
	transform: translateX(-50%);
	filter: drop-shadow(0 2px 4px rgba(26, 26, 26, 0.2));
}

.wex-lw__wheel {
	position: relative;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 6px solid #fff;
	box-shadow:
		0 12px 32px rgba(26, 26, 26, 0.14),
		0 4px 12px rgba(232, 68, 48, 0.12),
		inset 0 0 0 3px rgba(212, 175, 55, 0.35);
	transition: transform 5s cubic-bezier(0.25, 0.1, 0.25, 1);
	will-change: transform;
}

.wex-lw__slice-label {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 72px;
	margin-left: -36px;
	margin-top: -9px;
	font-size: 0.58rem;
	font-weight: 600;
	line-height: 1.15;
	text-align: center;
	pointer-events: none;
	transform-origin: center center;
}

.wex-lw__hub {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #f6e2a0 0%, var(--wex-gold) 45%, #b8860b 100%);
	border: 3px solid #fff;
	box-shadow: 0 2px 8px rgba(26, 26, 26, 0.2);
	transform: translate(-50%, -50%);
}

.wex-lw__hub::after {
	content: "";
	position: absolute;
	inset: 14px;
	border-radius: 50%;
	background: var(--wex-brand);
}

/* Modal */

.wex-lw__modal[hidden] {
	display: none;
}

.wex-lw__modal:not([hidden]) {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.wex-lw__modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(26, 26, 26, 0.45);
	animation: wex-lw-fade-in 0.25s ease forwards;
}

.wex-lw__modal-dialog {
	position: relative;
	z-index: 1;
	width: min(360px, 100%);
	padding: 28px 24px;
	border-radius: var(--wex-radius-lg);
	background:
		linear-gradient(165deg, #fff 0%, var(--wex-cream) 100%);
	text-align: center;
	box-shadow: 0 20px 48px rgba(26, 26, 26, 0.2);
	animation: wex-lw-scale-in 0.35s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

.wex-lw__modal-eyebrow {
	margin: 0 0 6px;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wex-brand);
}

.wex-lw__modal-copy {
	margin: 0 0 8px;
	font-size: 0.95rem;
	color: var(--wex-muted);
}

.wex-lw__modal-prize {
	margin: 0 0 22px;
	font-size: clamp(1.25rem, 4vw, 1.5rem);
	font-weight: 700;
	line-height: 1.3;
	color: var(--wex-text);
}

.wex-lw__modal-note {
	margin: -12px 0 22px;
	font-size: 0.82rem;
	line-height: 1.4;
	color: var(--wex-muted);
}

.wex-lw__modal-note[hidden] {
	display: none;
}

@keyframes wex-lw-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes wex-lw-scale-in {
	from {
		opacity: 0;
		transform: scale(0.92);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@media (min-width: 480px) {
	.wex-lw {
		padding: 36px 32px 44px;
	}

	.wex-lw__input {
		padding: 15px 18px;
	}
}
