/* =========================================================
   ELITE CORE AUTH MODAL - white + gold
   All rules scoped under .ecam-* to avoid theme collisions.
   ========================================================= */
.ecam-backdrop *,
.ecam-backdrop *::before,
.ecam-backdrop *::after {
	box-sizing: border-box;
}

.ecam-backdrop {
	--ecam-ink: #0A0A0A;
	--ecam-paper: #FAFAF8;
	--ecam-card: #FFFFFF;
	--ecam-border: #E8E4DC;
	--ecam-border-2: #D8D2C4;
	--ecam-muted: #6B6B6B;
	--ecam-muted-2: #9A9A96;
	--ecam-gold: #C9A961;
	--ecam-gold-hover: #B8954D;
	--ecam-cream: #F7F5F0;
	--ecam-error: #C2185B;

	--ecam-radius-sm: 6px;
	--ecam-radius: 10px;
	--ecam-radius-lg: 16px;

	--ecam-shadow: 0 40px 100px -20px rgba(30,25,15,0.35), 0 20px 40px -20px rgba(30,25,15,0.20);

	--ecam-sora: 'Sora', system-ui, -apple-system, Segoe UI, sans-serif;
	--ecam-inter: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;

	position: fixed;
	inset: 0;
	background: rgba(20, 15, 5, 0.55);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	font-family: var(--ecam-inter);
	color: var(--ecam-ink);
	line-height: 1.4;
}
.ecam-backdrop.is-open {
	display: flex;
	animation: ecamFadeIn 0.2s ease;
}
@keyframes ecamFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ecamSlideUp {
	from { opacity: 0; transform: translateY(20px) scale(0.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ecamSpin { to { transform: rotate(360deg); } }

.ecam-modal {
	background: var(--ecam-card);
	color: var(--ecam-ink);
	border-radius: var(--ecam-radius-lg);
	width: 100%;
	max-width: 440px;
	padding: 32px;
	position: relative;
	box-shadow: var(--ecam-shadow);
	animation: ecamSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	max-height: 92vh;
	overflow-y: auto;
	border: 1px solid var(--ecam-border);
	font-family: var(--ecam-inter);
	font-size: 14px;
}

.ecam-close {
	position: absolute;
	top: 16px;
	right: 16px;
	background: transparent;
	border: 0;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	cursor: pointer;
	color: var(--ecam-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.15s;
	padding: 0;
}
.ecam-close:hover { background: var(--ecam-cream); color: var(--ecam-ink); }

.ecam-product-strip {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	background: var(--ecam-cream);
	border: 1px solid var(--ecam-border);
	border-radius: var(--ecam-radius-sm);
	margin-bottom: 20px;
}
.ecam-product-img {
	width: 40px; height: 40px;
	border-radius: 4px;
	object-fit: cover;
	flex-shrink: 0;
	background: var(--ecam-card);
	border: 1px solid var(--ecam-border);
}
.ecam-product-img-fallback {
	background: linear-gradient(180deg, #f4f0e8 0%, #fff 40%, #e8dfc9 100%);
}
.ecam-product-name {
	font-weight: 700;
	font-size: 13px;
	color: var(--ecam-ink);
	line-height: 1.3;
}
.ecam-product-price {
	font-size: 13px;
	color: var(--ecam-muted);
	margin-top: 2px;
}
.ecam-product-price del { opacity: 0.7; margin-right: 4px; }

.ecam-header { margin-bottom: 18px; }
.ecam-title {
	font-family: var(--ecam-sora) !important;
	font-weight: 800 !important;
	font-size: 24px !important;
	letter-spacing: -0.02em;
	color: var(--ecam-ink) !important;
	margin: 0 0 6px 0 !important;
	line-height: 1.2 !important;
	text-transform: none !important;
}
.ecam-subtitle {
	font-size: 13px;
	color: var(--ecam-muted);
	line-height: 1.5;
	margin: 0;
}

/* Google */
.ecam-social { margin-bottom: 14px; }
.ecam-google-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	background: #FFFFFF;
	color: var(--ecam-ink);
	border: 1px solid var(--ecam-border-2);
	padding: 12px 16px;
	border-radius: var(--ecam-radius);
	font-family: var(--ecam-inter);
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.15s;
	text-decoration: none;
}
.ecam-google-btn:hover {
	background: var(--ecam-cream);
	border-color: var(--ecam-muted-2);
	color: var(--ecam-ink);
	text-decoration: none;
}
.ecam-google-btn svg { flex-shrink: 0; }

.ecam-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 14px 0;
	color: var(--ecam-muted-2);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.ecam-divider::before,
.ecam-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--ecam-border);
}

.ecam-tabs {
	display: flex;
	background: var(--ecam-cream);
	border: 1px solid var(--ecam-border);
	border-radius: var(--ecam-radius-sm);
	padding: 4px;
	margin-bottom: 18px;
}
.ecam-tab {
	flex: 1;
	background: transparent;
	border: 0;
	padding: 10px 12px;
	font-family: var(--ecam-inter);
	font-weight: 600;
	font-size: 13px;
	color: var(--ecam-muted);
	cursor: pointer;
	border-radius: var(--ecam-radius-sm);
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	line-height: 1;
}
.ecam-tab:hover { color: var(--ecam-ink); }
.ecam-tab.is-active {
	background: var(--ecam-ink);
	color: #fff;
	font-weight: 700;
	box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.ecam-tab svg { width: 14px; height: 14px; flex-shrink: 0; }

.ecam-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }

/* CRITICAL: [hidden] must always beat any display: flex above. */
.ecam-backdrop [hidden],
.ecam-modal [hidden] { display: none !important; }

/* Auth mode (universal sign-in/sign-up, no product): give the header a little more room */
.ecam-modal.is-auth-mode .ecam-header { margin-bottom: 20px; margin-top: 4px; }
.ecam-field { display: flex; flex-direction: column; gap: 6px; }
.ecam-field label {
	font-size: 12px;
	font-weight: 600;
	color: var(--ecam-ink);
	letter-spacing: 0.02em;
	margin: 0;
	line-height: 1.2;
}
.ecam-field input {
	height: 46px;
	padding: 0 14px;
	border: 1px solid var(--ecam-border-2);
	border-radius: var(--ecam-radius-sm);
	font-family: var(--ecam-inter);
	font-size: 14px;
	color: var(--ecam-ink);
	background: var(--ecam-card);
	transition: all 0.15s;
	line-height: 1;
	width: 100%;
	box-shadow: none;
}
.ecam-field input:focus {
	outline: 0;
	border-color: var(--ecam-gold);
	box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.20);
}
.ecam-field input::placeholder { color: var(--ecam-muted-2); }

.ecam-phone-wrap { display: flex; gap: 8px; }
.ecam-phone-cc {
	height: 46px;
	padding: 0 14px;
	border: 1px solid var(--ecam-border-2);
	border-radius: var(--ecam-radius-sm);
	background: var(--ecam-card);
	color: var(--ecam-ink);
	font-size: 14px;
	font-family: var(--ecam-inter);
	font-weight: 600;
	flex-shrink: 0;
	width: 108px;
	cursor: pointer;
	transition: all 0.15s;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	padding-right: 32px;
}
.ecam-phone-cc:focus { outline: 0; border-color: var(--ecam-gold); box-shadow: 0 0 0 3px rgba(201,169,97,0.2); }
.ecam-phone-wrap input { flex: 1; }

.ecam-password-wrap { position: relative; }
.ecam-password-wrap input { padding-right: 40px; }
.ecam-password-toggle {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: 0;
	padding: 6px;
	color: var(--ecam-muted);
	cursor: pointer;
	border-radius: 4px;
	display: flex;
	align-items: center;
}
.ecam-password-toggle:hover { color: var(--ecam-ink); }

.ecam-forgot {
	align-self: flex-end;
	font-size: 12px;
	color: var(--ecam-muted);
	text-decoration: none;
	margin-top: 2px;
}
.ecam-forgot:hover { color: var(--ecam-gold-hover); text-decoration: underline; }

.ecam-subtabs {
	display: flex;
	gap: 20px;
	margin-bottom: 14px;
	border-bottom: 1px solid var(--ecam-border);
}
.ecam-subtab {
	background: transparent;
	border: 0;
	padding: 8px 0;
	font-family: var(--ecam-inter);
	font-weight: 600;
	font-size: 13px;
	color: var(--ecam-muted);
	cursor: pointer;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	transition: all 0.15s;
}
.ecam-subtab:hover { color: var(--ecam-ink); }
.ecam-subtab.is-active {
	color: var(--ecam-ink);
	border-bottom-color: var(--ecam-gold);
}

.ecam-submit {
	width: 100%;
	background: var(--ecam-ink);
	color: #fff;
	border: 0;
	padding: 14px 20px;
	border-radius: var(--ecam-radius);
	font-family: var(--ecam-inter);
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: all 0.15s;
	margin-top: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	line-height: 1;
}
.ecam-submit:hover { background: #1a1a1a; box-shadow: 0 6px 16px -6px rgba(0,0,0,0.3); }
.ecam-submit:active { transform: translateY(1px); }
.ecam-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.ecam-gold-arrow { color: var(--ecam-gold); font-weight: 700; }

.ecam-legal {
	font-size: 11px;
	color: var(--ecam-muted);
	text-align: center;
	line-height: 1.5;
	margin: 6px 0 0 0;
}
.ecam-legal a { color: var(--ecam-muted); text-decoration: underline; }
.ecam-legal a:hover { color: var(--ecam-ink); }

.ecam-otp-back {
	background: transparent;
	border: 0;
	color: var(--ecam-muted);
	font-size: 12px;
	font-family: var(--ecam-inter);
	cursor: pointer;
	padding: 6px 0;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-bottom: 4px;
}
.ecam-otp-back:hover { color: var(--ecam-ink); }

.ecam-otp-inputs {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin: 8px 0 6px;
}
.ecam-otp-inputs input {
	width: 46px;
	height: 54px;
	text-align: center;
	font-family: var(--ecam-sora);
	font-weight: 700;
	font-size: 22px;
	padding: 0;
	border: 1px solid var(--ecam-border-2);
	border-radius: var(--ecam-radius-sm);
	background: var(--ecam-card);
	color: var(--ecam-ink);
	transition: all 0.15s;
}
.ecam-otp-inputs input:focus {
	outline: 0;
	border-color: var(--ecam-gold);
	box-shadow: 0 0 0 3px rgba(201,169,97,0.2);
}
.ecam-otp-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 12px;
	color: var(--ecam-muted);
	margin-bottom: 4px;
}
.ecam-otp-meta a { color: var(--ecam-gold-hover); text-decoration: none; font-weight: 600; }
.ecam-otp-meta a:hover { text-decoration: underline; }
.ecam-otp-meta strong { color: var(--ecam-ink); font-weight: 700; }

.ecam-loading { padding: 40px 20px; text-align: center; }
.ecam-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid var(--ecam-cream);
	border-top-color: var(--ecam-gold);
	border-radius: 50%;
	margin: 0 auto 20px;
	animation: ecamSpin 0.8s linear infinite;
}
.ecam-loading-text { color: var(--ecam-muted); font-size: 13px; margin: 0; }

.ecam-error {
	padding: 10px 12px;
	background: rgba(194, 24, 91, 0.06);
	border: 1px solid rgba(194, 24, 91, 0.25);
	border-radius: var(--ecam-radius-sm);
	color: var(--ecam-error);
	font-size: 12px;
	line-height: 1.4;
}
.ecam-error a { color: var(--ecam-error); font-weight: 600; text-decoration: underline; }

@media (max-width: 500px) {
	.ecam-backdrop { padding: 12px; }
	.ecam-modal { padding: 24px 20px; border-radius: var(--ecam-radius); }
	.ecam-title { font-size: 20px !important; }
	.ecam-otp-inputs input { width: 40px; height: 48px; font-size: 20px; }
}

/* v1.3.7: brief "verifying" state on ATC buttons while /state confirms auth */
.ec-verifying { opacity: 0.7; pointer-events: none; }
