/**
 * MIRA Discovery — Layout & Component Styles
 *
 * Colors : 100% from Foxiz theme CSS variables (--g-color, --btn-primary, --body-fcolor, etc.)
 * Fonts  : 100% from Foxiz theme CSS variables (--body-family, --h1-family)
 * Dark mode : handled automatically by Foxiz [data-theme='dark'] + border overrides below
 * This file contains ONLY: layout, sizing, spacing, animations, and minimal overrides.
 */

/* ── Alpine.js ── */
[x-cloak] { display: none !important; }

/* ── Discovery page: override theme content wrappers ── */
body.emtm-discover-page .emtm-discover-wrap {
	padding: 0;
	margin: 0;
	max-width: 100%;
}
body.emtm-discover-page .entry-content,
body.emtm-discover-page .page-content,
body.emtm-discover-page .rb-section {
	padding: 0;
	margin: 0;
	max-width: 100%;
}

/* ══════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════ */

/* ── App container — top-anchored, mobile-first ── */
#ed-app {
	width: 100%;
	min-height: 100dvh;
	min-height: 100vh; /* Fallback for older browsers */
	background: var(--solid-white);
	font-family: var(--body-family);
	color: var(--body-fcolor);
	display: flex;
	flex-direction: column;
	-webkit-font-smoothing: antialiased;
}

/* ── Shell — top-anchored, NOT vertically centered ── */
.ed-shell {
	flex: 1;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start; /* TOP-ANCHORED, not center */
	overflow-y: auto;
	overflow-x: hidden;
	padding: 32px 20px 40px;
}
@media (min-width: 768px) {
	.ed-shell {
		padding: 48px 32px 60px;
	}
}

/* ── Screen wrapper — left-aligned for long content, centered for short ── */
.ed-v2-screen {
	width: 100%;
	max-width: 680px;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start; /* Left-aligned by default */
	text-align: left;
}
/* Landing, teaser, and payment screens stay centered */
.ed-v2-screen--centered {
	align-items: center;
	text-align: center;
}

/* ══════════════════════════════════════════════
   LANDING SCREEN
   ══════════════════════════════════════════════ */

.ed-landing-orb {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--g-color), color-mix(in srgb, var(--g-color) 80%, #000));
	margin-bottom: 44px;
	position: relative;
	animation: ed-orb 3s ease-in-out infinite;
}
.ed-landing-orb::after {
	content: '';
	position: absolute;
	inset: -8px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--g-color) 22%, transparent);
	z-index: -1;
	animation: ed-ring 3s ease-in-out infinite;
}

.ed-landing-headline {
	font-family: var(--h1-family);
	font-size: clamp(28px, 5vw, 52px);
	font-weight: 700;
	color: var(--body-fcolor);
	line-height: 1.07;
	letter-spacing: -0.025em;
	margin-bottom: 18px;
	max-width: 600px;
}

.ed-landing-sub {
	font-family: var(--body-family);
	font-size: clamp(15px, 2vw, 17px);
	color: var(--meta-fcolor);
	line-height: 1.78;
	max-width: 480px;
	margin-bottom: 40px;
}

/* ══════════════════════════════════════════════
   PHASE LABEL
   ══════════════════════════════════════════════ */

.ed-phase-label {
	font-family: var(--body-family);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--g-color);
	opacity: 0.7;
	margin-bottom: 12px;
}

/* ══════════════════════════════════════════════
   QUESTION TEXT
   ══════════════════════════════════════════════ */

.ed-question {
	font-family: var(--h1-family);
	font-size: clamp(22px, 4vw, 38px);
	font-weight: 700;
	color: var(--body-fcolor);
	line-height: 1.15;
	letter-spacing: -0.025em;
	max-width: 680px;
	margin-bottom: 40px;
	white-space: pre-line;
}
.ed-question--long {
	font-size: clamp(16px, 2.5vw, 22px);
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: -0.01em;
}

/* ══════════════════════════════════════════════
   TEXT INPUT — floating style, no box
   ══════════════════════════════════════════════ */

.ed-textarea {
	width: 100%;
	max-width: 640px;
	background: transparent;
	border: none;
	border-bottom: 1px solid var(--flex-gray-15);
	outline: none;
	color: var(--body-fcolor);
	font-family: var(--body-family);
	font-size: clamp(17px, 2.5vw, 20px);
	line-height: 1.78;
	text-align: left;
	resize: none;
	overflow: hidden;
	padding: 0 0 12px 0;
	margin-bottom: 36px;
	min-height: 1.78em;
	box-sizing: border-box;
	transition: border-color 0.2s;
}
.ed-textarea:focus {
	border-bottom-color: var(--g-color);
}
.ed-textarea::placeholder {
	color: var(--excerpt-color);
	font-size: clamp(15px, 2vw, 17px);
}
.ed-textarea:disabled { opacity: 0.4; }

/* Email input — same floating style */
.ed-input--email {
	width: 100%;
	max-width: 640px;
	background: transparent;
	border: none;
	border-bottom: 1px solid var(--flex-gray-15);
	outline: none;
	color: var(--body-fcolor);
	font-family: var(--body-family);
	font-size: clamp(17px, 2.5vw, 20px);
	line-height: 1.78;
	text-align: center;
	padding: 0 0 12px 0;
	margin-bottom: 36px;
	box-sizing: border-box;
	transition: border-color 0.2s;
}
.ed-input--email:focus {
	border-bottom-color: var(--g-color);
}
.ed-input--email::placeholder {
	color: var(--excerpt-color);
}

/* Name input — same floating style */
.ed-input--name {
	width: 100%;
	max-width: 480px;
	background: transparent;
	border: none;
	border-bottom: 1px solid var(--flex-gray-15);
	outline: none;
	color: var(--body-fcolor);
	font-family: var(--body-family);
	font-size: clamp(17px, 2.5vw, 20px);
	line-height: 1.78;
	text-align: center;
	padding: 0 0 12px 0;
	margin-bottom: 24px;
	box-sizing: border-box;
	transition: border-color 0.2s;
}
.ed-input--name:focus {
	border-bottom-color: var(--g-color);
}
.ed-input--name::placeholder {
	color: var(--excerpt-color);
}

/* ── Word count ── */
.ed-word-count {
	font-size: 11px;
	color: var(--excerpt-color);
	text-align: right;
	margin-top: -30px;
	margin-bottom: 20px;
	padding-right: 4px;
	width: 100%;
	max-width: 640px;
}

/* ══════════════════════════════════════════════
   CONTROLS BAR
   ══════════════════════════════════════════════ */

.ed-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	width: 100%;
	max-width: 640px;
}

/* ══════════════════════════════════════════════
   MIC BUTTON
   ══════════════════════════════════════════════ */

.ed-mic {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: 2px solid var(--flex-gray-15);
	background: transparent;
	color: var(--meta-fcolor);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
	padding: 0;
	flex-shrink: 0;
}
.ed-mic svg { width: 22px; height: 22px; pointer-events: none; }
.ed-mic:hover {
	border-color: var(--g-color);
	color: var(--g-color);
	background: color-mix(in srgb, var(--g-color) 12%, transparent);
}
.ed-mic.recording {
	border-color: var(--g-color);
	background: var(--g-color);
	color: #fff;
	animation: ed-mic-pulse 1s infinite;
	box-shadow: 0 0 0 6px color-mix(in srgb, var(--g-color) 12%, transparent);
}

/* ── Recording info ── */
.ed-rec-info {
	font-family: var(--body-family);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.10em;
	text-transform: uppercase;
	color: var(--g-color);
	text-align: center;
	white-space: nowrap;
	display: flex;
	align-items: center;
	gap: 8px;
}
.ed-rec-bar {
	width: 80px;
	height: 4px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 2px;
	overflow: hidden;
}
.ed-rec-fill {
	height: 100%;
	width: 0%;
	background: var(--g-color);
	border-radius: 2px;
	transition: width 1s linear;
}

/* ══════════════════════════════════════════════
   PROCESSING OVERLAY
   ══════════════════════════════════════════════ */

/* When processing: hide ALL screen content, show only the orb */
#ed-app.is-processing .ed-v2-screen {
	display: none !important;
}

/* Processing overlay — FIXED, fully owns the screen, blocks all interaction */
.ed-processing {
	display: none;
	position: fixed;
	inset: 0;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 32px;
	background: var(--dark-accent);
	z-index: 9000;
}
#ed-app[x-data] .ed-processing { display: flex; }

.ed-proc-orb {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: radial-gradient(circle, var(--g-color) 0%, color-mix(in srgb, var(--g-color) 35%, transparent) 55%, transparent 100%);
	animation: ed-breathe 2.4s ease-in-out infinite;
	box-shadow:
		0 0 40px color-mix(in srgb, var(--g-color) 40%, transparent),
		0 0 80px color-mix(in srgb, var(--g-color) 15%, transparent),
		0 0 120px color-mix(in srgb, var(--g-color) 5%, transparent);
}

.ed-proc-msg {
	font-size: 15px;
	color: var(--meta-fcolor);
	font-style: italic;
	letter-spacing: 0.02em;
	text-align: center;
	transition: opacity 0.6s ease;
	min-height: 22px;
}

/* ══════════════════════════════════════════════
   CALIBRATION
   ══════════════════════════════════════════════ */

.ed-calibration {
	width: 100%;
	max-width: 520px;
	display: flex;
	flex-direction: column;
	gap: 18px;
	margin-bottom: 28px;
}
.ed-selector {
	display: flex;
	border: 1px solid var(--flex-gray-15);
	border-radius: var(--round-7);
	overflow: hidden;
}
.ed-selector-opt {
	flex: 1;
	padding: 14px 8px;
	border: none;
	background: transparent;
	color: var(--meta-fcolor);
	font-family: var(--body-family);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	transition: all 0.2s;
	text-align: center;
	touch-action: manipulation;
	user-select: none;
}
.ed-selector-opt:not(:last-child) {
	border-right: 1px solid var(--flex-gray-15);
}
.ed-selector-opt:hover,
.ed-selector-opt.selected {
	color: var(--g-color);
	background: color-mix(in srgb, var(--g-color) 12%, transparent);
}

/* ══════════════════════════════════════════════
   TEASER
   ══════════════════════════════════════════════ */

.ed-teaser-block {
	padding: 28px 32px;
	background: color-mix(in srgb, var(--g-color) 8%, transparent);
	border-left: 3px solid var(--g-color);
	border-radius: 0 var(--round-7) var(--round-7) 0;
	margin-bottom: 32px;
	max-width: 600px;
	text-align: left;
}
.ed-teaser-text {
	font-family: var(--body-family);
	font-size: 17px;
	line-height: 1.78;
	color: var(--body-fcolor);
	font-style: italic;
}

/* ══════════════════════════════════════════════
   CHECKOUT
   ══════════════════════════════════════════════ */

.ed-checkout-heading {
	font-family: var(--h1-family);
	font-size: clamp(24px, 4vw, 36px);
	font-weight: 700;
	color: var(--body-fcolor);
	line-height: 1.1;
	letter-spacing: -0.025em;
	margin-bottom: 12px;
}
.ed-checkout-sub {
	font-family: var(--body-family);
	font-size: 14px;
	color: var(--meta-fcolor);
}
.ed-checkout-secure {
	font-family: var(--body-family);
	font-size: 13px;
	color: var(--excerpt-color);
}

/* ══════════════════════════════════════════════
   EXIT / TERMINAL
   ══════════════════════════════════════════════ */


/* ══════════════════════════════════════════════
   BUTTONS — base system (used in discovery flow)
   ══════════════════════════════════════════════ */

.emt-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	font-weight: 700;
	border-radius: var(--round-7);
	transition: background 0.18s, transform 0.1s, box-shadow 0.18s;
	white-space: nowrap;
	cursor: pointer;
	border: none;
}
.emt-btn--primary {
	background: var(--btn-primary);
	color: var(--btn-accent);
	font-size: 15px;
	padding: 14px 28px;
}
.emt-btn--primary:hover {
	background: var(--btn-primary-h);
	color: var(--btn-accent-h);
	transform: translateY(-1px);
	box-shadow: 0 8px 28px color-mix(in srgb, var(--btn-primary) 45%, transparent);
}
.emt-btn--lg {
	font-size: 17px;
	padding: 17px 40px;
}

/* Dark mode: mint → orange (Foxiz --g-color handles the brand orange in dark mode) */
[data-theme='dark'] .emt-btn--primary {
	background: var(--g-color);
	color: #fff;
}
[data-theme='dark'] .emt-btn--primary:hover {
	background: color-mix(in srgb, var(--g-color) 80%, #000);
	color: #fff;
	box-shadow: 0 8px 28px color-mix(in srgb, var(--g-color) 35%, transparent);
}

/* ══════════════════════════════════════════════
   HOMEPAGE CTA BUTTON (external link to /discover/)
   ══════════════════════════════════════════════ */

.emtm-discovery-link-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 16px 34px;
	line-height: 1;
	background: var(--btn-primary);
	color: var(--btn-accent) !important;
	font-family: var(--body-family);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.10em;
	text-transform: uppercase;
	border-radius: var(--round-7);
	text-decoration: none !important;
	font-style: normal !important;
	transition: all 0.22s ease;
}
.emtm-discovery-link-btn:hover {
	background: var(--btn-primary-h);
	color: var(--btn-accent-h) !important;
	transform: translateY(-1px);
	box-shadow: 0 8px 28px color-mix(in srgb, var(--btn-primary) 35%, transparent);
	text-decoration: none !important;
}
[data-theme='dark'] .emtm-discovery-link-btn {
	background: var(--g-color) !important;
	color: #fff !important;
}
[data-theme='dark'] .emtm-discovery-link-btn:hover {
	background: color-mix(in srgb, var(--g-color) 80%, #000) !important;
	color: #fff !important;
	box-shadow: 0 8px 28px color-mix(in srgb, var(--g-color) 25%, transparent);
}

/* ══════════════════════════════════════════════
   FOCUS STATES
   ══════════════════════════════════════════════ */

.ed-textarea:focus-visible,
.ed-input--email:focus-visible,
.ed-input--name:focus-visible {
	outline: 2px solid var(--g-color);
	outline-offset: 2px;
}
.ed-mic:focus-visible {
	outline: 2px solid var(--g-color);
	outline-offset: 2px;
}

/* ══════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════ */

@keyframes ed-orb {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.05); }
}
@keyframes ed-ring {
	0%, 100% { opacity: 0.25; transform: scale(1); }
	50% { opacity: 0.08; transform: scale(1.4); }
}
@keyframes ed-breathe {
	0%, 100% {
		transform: scale(0.75);
		opacity: 0.5;
		box-shadow:
			0 0 25px color-mix(in srgb, var(--g-color) 25%, transparent),
			0 0 50px color-mix(in srgb, var(--g-color) 8%, transparent);
	}
	50% {
		transform: scale(1.2);
		opacity: 1;
		box-shadow:
			0 0 50px color-mix(in srgb, var(--g-color) 50%, transparent),
			0 0 100px color-mix(in srgb, var(--g-color) 20%, transparent),
			0 0 160px color-mix(in srgb, var(--g-color) 6%, transparent);
	}
}
@keyframes ed-mic-pulse {
	0%, 100% { opacity: 1; box-shadow: 0 0 0 6px color-mix(in srgb, var(--g-color) 12%, transparent); }
	50% { opacity: 0.8; box-shadow: 0 0 0 14px color-mix(in srgb, var(--g-color) 12%, transparent); }
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */

@media (max-width: 768px) {
	.ed-shell { padding: 16px 8px; }
	.ed-v2-screen { max-width: 100%; padding: 0 8px; }
	.ed-question { font-size: clamp(20px, 5vw, 30px); }
	.ed-question--long { font-size: clamp(15px, 3.5vw, 19px); }
	.ed-textarea { font-size: 17px; }
	.ed-calibration { max-width: 100%; }
	.ed-selector-opt { font-size: 13px; padding: 12px 4px; }
	.ed-landing-headline { font-size: clamp(26px, 7vw, 38px); }
	.ed-mic { width: 50px; height: 50px; }
	.ed-controls { gap: 16px; }
}

/* ══════════════════════════════════════════════
   V2: PATTERN SIGNAL
   ══════════════════════════════════════════════ */

.ed-signal-intro {
	font-size: 14px;
	color: var(--meta-fcolor);
	text-align: center;
	margin-bottom: 20px;
}

.ed-signal-block {
	background: color-mix(in srgb, var(--g-color) 6%, transparent);
	border-left: 3px solid var(--g-color);
	border-radius: 8px;
	padding: 20px 24px;
	max-width: 540px;
	margin: 0 auto;
}

.ed-signal-text {
	font-size: 16px;
	line-height: 1.7;
	color: var(--body-fcolor);
	font-style: italic;
}

.ed-signal-bridge {
	font-size: 14px;
	line-height: 1.6;
	color: var(--meta-fcolor);
	text-align: center;
	margin-top: 16px;
	max-width: 480px;
	margin-left: auto;
	margin-right: auto;
}

/* ══════════════════════════════════════════════
   V2: EMAIL GATE
   ══════════════════════════════════════════════ */

.ed-email-gate {
	max-width: 420px;
	margin: 0 auto;
	text-align: center;
}

.ed-email-gate-heading {
	font-size: clamp(20px, 4vw, 28px);
	font-weight: 700;
	color: var(--body-fcolor);
	margin-bottom: 8px;
}

.ed-email-gate-sub {
	font-size: 14px;
	color: var(--meta-fcolor);
	line-height: 1.6;
	margin-bottom: 24px;
}

/* ══════════════════════════════════════════════
   V2: PATTERN PREVIEW
   ══════════════════════════════════════════════ */

.ed-preview-intro {
	font-size: 12px;
	color: var(--g-color);
	font-weight: 600;
	text-align: center;
	margin-bottom: 20px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.ed-preview-block {
	background: color-mix(in srgb, var(--g-color) 6%, transparent);
	border-left: 4px solid var(--g-color);
	border-radius: 10px;
	padding: 28px 28px;
	max-width: 580px;
	margin: 0 auto;
}

.ed-preview-text {
	font-size: 17px;
	line-height: 1.75;
	color: var(--body-fcolor);
}

.ed-preview-bridge {
	font-size: 15px;
	line-height: 1.6;
	color: var(--meta-fcolor);
	text-align: center;
	margin-top: 20px;
	font-style: italic;
	max-width: 500px;
	margin-left: auto;
	margin-right: auto;
}

/* ══════════════════════════════════════════════
   V2: CALIBRATION NAME
   ══════════════════════════════════════════════ */

.ed-calibration-name {
	margin-bottom: 24px;
}

.ed-cal-explain {
	font-size: 13px;
	color: var(--excerpt-color);
	margin-bottom: 16px;
	line-height: 1.5;
}

/* ══════════════════════════════════════════════
   PAYMENT FORM (SureCart — future styles here)
   ══════════════════════════════════════════════ */

/* ── Dark mode: input border overrides ──
   Foxiz --flex-gray-15 stays light in dark mode; override to dark for discovery inputs */
[data-theme='dark'] #ed-app .ed-textarea,
[data-theme='dark'] #ed-app .ed-input--email,
[data-theme='dark'] #ed-app .ed-input--name { border-bottom-color: #2a2a2a; }
[data-theme='dark'] #ed-app .ed-selector { border-color: #2a2a2a; }
[data-theme='dark'] #ed-app .ed-selector-opt:not(:last-child) { border-right-color: #2a2a2a; }
[data-theme='dark'] #ed-app .ed-mic { border-color: #2a2a2a; }
