/* =========================================================
   WC Login Popup
   Scoped under #wclp-modal so theme styles don't leak in.
   ========================================================= */

#wclp-modal {
	/* Mapped to the theme's design tokens (fallbacks = theme values). */
	--wclp-primary:       var(--primary, #d93a11);
	--wclp-primary-5:     var(--primary-5, #d93a110d);
	--wclp-primary-10:    var(--primary-10, #d93a111a);
	--wclp-primary-20:    var(--primary-20, #d93a1133);
	--wclp-primary-30:    var(--primary-30, #d93a114d);
	--wclp-primary-40:    var(--primary-40, #d93a1166);
	--wclp-primary-60:    var(--primary-60, #d93a1199);
	--wclp-secondary:     var(--secondary, #008489);
	--wclp-secondary-10:  var(--secondary-10, #0084891a);
	--wclp-secondary-30:  var(--secondary-30, #0084894d);
	--wclp-secondary-50:  var(--secondary-50, #00848980);
	--wclp-error-text:    var(--secondary-d-2, #913D3B);
	--wclp-tertiary:      var(--tertiary, #ffe066);
	--wclp-ink:           var(--text-title, #000000);
	--wclp-text:          var(--text-body, #333333);
	--wclp-muted:         var(--dark-60, hsla(0, 0%, 0%, .6));
	--wclp-surface:       var(--bg-surface, #ffffff);
	--wclp-line:          var(--dark-10, hsla(0, 0%, 0%, .1));
	--wclp-soft:          var(--dark-5, hsla(0, 0%, 0%, .05));
	--wclp-shadow:        var(--shadow-primary, hsla(0, 0%, 0%, .15));
	--wclp-overlay:       var(--dark-60, hsla(0, 0%, 0%, .6));
	--wclp-radius: 14px;
	--wclp-font: 'Quicksand', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

body.wclp-modal-active { overflow: hidden; }

/* ---------- Overlay ---------- */
#wclp-modal.wclp-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: var(--wclp-overlay);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	opacity: 0;
	transition: opacity .25s ease;
	overflow-y: auto;
	font-family: var(--wclp-font);
}
#wclp-modal[hidden] { display: none !important; }
#wclp-modal.is-open { opacity: 1; }

/* ---------- Dialog ---------- */
#wclp-modal .wclp-dialog {
	position: relative;
	width: 100%;
	max-width: 400px;
	margin: auto;
	background: linear-gradient(var(--wclp-primary-5), var(--wclp-primary-5)), var(--wclp-surface);
	border: 1px solid var(--wclp-line);
	border-radius: 28px;
	box-shadow: 0 30px 80px var(--wclp-shadow);
	color: var(--wclp-text);
	transform: translateY(16px) scale(.97);
	transition: transform .3s cubic-bezier(.2, .9, .3, 1.2);
	box-sizing: border-box;
	text-align: left;
}
#wclp-modal.is-open .wclp-dialog { transform: none; }
#wclp-modal *, #wclp-modal *::before, #wclp-modal *::after { box-sizing: border-box; }

/* ---------- Header ---------- */
#wclp-modal .wclp-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 20px 18px 32px;
	border-bottom: 1px solid var(--wclp-line);
}
#wclp-modal .wclp-title {
	margin: 0;
	padding: 0;
	font-family: var(--wclp-font);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0;
	color: var(--wclp-ink);
	text-transform: none;
}
#wclp-modal .wclp-close {
	all: unset;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--wclp-line);
	color: var(--wclp-text);
	cursor: pointer;
	transition: background .2s, transform .2s;
}
#wclp-modal .wclp-close:hover { background: var(--wclp-primary-10); color: var(--wclp-primary); transform: rotate(90deg); }
#wclp-modal .wclp-close:focus-visible { outline: 2px solid var(--wclp-primary); outline-offset: 2px; }
#wclp-modal .wclp-close svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- Body ---------- */
#wclp-modal .wclp-body { padding: 26px 32px 26px; }

#wclp-modal .wclp-view { margin: 0; animation: wclpFade .25s ease; }
#wclp-modal .wclp-view[hidden] { display: none; }
@keyframes wclpFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

#wclp-modal .wclp-intro {
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--wclp-muted);
	font-weight: 500;
}

/* ---------- Fields ---------- */
#wclp-modal .wclp-field {
	position: relative;
	margin: 0 0 12px;
}
#wclp-modal .wclp-field input,
#wclp-modal .wclp-field select {
	display: block;
	width: 100%;
	height: 50px;
	margin: 0;
	padding: 0 16px;
	font-family: var(--wclp-font);
	font-size: 15px;
	font-weight: 600;
	color: var(--wclp-ink);
	background: var(--wclp-surface);
	border: 1.5px solid var(--wclp-line);
	border-radius: var(--wclp-radius);
	box-shadow: 0 2px 8px var(--wclp-soft);
	outline: none;
	transition: border-color .2s, box-shadow .2s;
	-webkit-appearance: none;
	appearance: none;
	min-height: 0;
	line-height: normal;
}
#wclp-modal .wclp-field input::placeholder { color: var(--wclp-text); opacity: .85; font-weight: 600; }
#wclp-modal .wclp-field input:focus,
#wclp-modal .wclp-field select:focus {
	border-color: var(--wclp-primary-60);
	box-shadow: 0 0 0 4px var(--wclp-primary-20);
}
#wclp-modal .wclp-field.is-invalid input { border-color: var(--wclp-primary); }

#wclp-modal .wclp-has-eye input { padding-right: 50px; }
#wclp-modal .wclp-eye {
	all: unset;
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	width: 30px;
	height: 30px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	color: var(--wclp-muted);
	cursor: pointer;
}
#wclp-modal .wclp-eye:hover { color: var(--wclp-primary); }
#wclp-modal .wclp-eye:focus-visible { outline: 2px solid var(--wclp-primary); }
#wclp-modal .wclp-eye svg { width: 21px; height: 21px; fill: currentColor; }
#wclp-modal .wclp-eye .wclp-i-hide { display: none; }
#wclp-modal .wclp-eye.is-visible .wclp-i-show { display: none; }
#wclp-modal .wclp-eye.is-visible .wclp-i-hide { display: block; }

/* WhatsApp field: [icon][+91 ▾][number] in one pill */
#wclp-modal .wclp-phone {
	display: flex;
	align-items: center;
	height: 50px;
	background: var(--wclp-surface);
	border: 1.5px solid var(--wclp-line);
	border-radius: var(--wclp-radius);
	box-shadow: 0 2px 8px var(--wclp-soft);
	transition: border-color .2s, box-shadow .2s;
}
#wclp-modal .wclp-phone:focus-within { border-color: var(--wclp-primary-60); box-shadow: 0 0 0 4px var(--wclp-primary-20); }
#wclp-modal .wclp-phone.is-invalid { border-color: var(--wclp-primary); }
#wclp-modal .wclp-phone .wclp-wa-icon {
	flex: 0 0 auto;
	display: inline-flex;
	padding-left: 14px;
	color: #25d366;
}
#wclp-modal .wclp-phone .wclp-wa-icon svg { width: 20px; height: 20px; fill: currentColor; }
#wclp-modal .wclp-phone .wclp-cc {
	flex: 0 0 auto;
	padding: 0 12px 0 8px;
	font-size: 15px;
	font-weight: 700;
	color: var(--wclp-ink);
	border-right: 1px solid var(--wclp-line);
	line-height: 24px;
}
#wclp-modal .wclp-phone input {
	height: 100%;
	border: 0 !important;
	box-shadow: none !important;
	background-color: transparent;
	border-radius: 0;
}
#wclp-modal .wclp-phone input { flex: 1 1 auto; min-width: 0; padding-left: 12px; }

/* Password strength */
#wclp-modal .wclp-meter {
	display: flex;
	align-items: center;
	gap: 5px;
	margin: -4px 4px 12px;
	height: 14px;
}
#wclp-modal .wclp-meter span {
	flex: 1;
	height: 4px;
	border-radius: 4px;
	background: var(--wclp-line);
	transition: background .2s;
}
#wclp-modal .wclp-meter em {
	flex: 0 0 52px;
	font-style: normal;
	font-size: 11px;
	font-weight: 700;
	text-align: right;
	color: var(--wclp-muted);
}
#wclp-modal .wclp-meter[data-score="1"] span:nth-child(-n+1) { background: var(--wclp-primary); }
#wclp-modal .wclp-meter[data-score="2"] span:nth-child(-n+2) { background: var(--wclp-tertiary); }
#wclp-modal .wclp-meter[data-score="3"] span:nth-child(-n+3) { background: var(--wclp-secondary-50); }
#wclp-modal .wclp-meter[data-score="4"] span:nth-child(-n+4) { background: var(--wclp-secondary); }

/* Honeypot */
#wclp-modal .wclp-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Links & text ---------- */
#wclp-modal .wclp-center { text-align: center; margin: 14px 0 18px; }
#wclp-modal .wclp-link {
	color: var(--wclp-primary);
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	box-shadow: none;
	border: 0;
}
#wclp-modal .wclp-link:hover { text-decoration: underline; }
#wclp-modal .wclp-small {
	margin: 14px 0 0;
	text-align: center;
	font-size: 12px;
	color: var(--wclp-muted);
	font-weight: 500;
}
#wclp-modal .wclp-small .wclp-link { font-size: 12px; }
#wclp-modal .wclp-geo-note {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 6px;
	margin-top: 12px;
	font-size: 11.5px;
	line-height: 1.45;
}
#wclp-modal .wclp-geo-note svg { flex: 0 0 14px; width: 14px; height: 14px; margin-top: 1px; fill: var(--wclp-secondary); }

/* ---------- Button ---------- */
#wclp-modal .wclp-btn {
	all: unset;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 50px;
	margin-top: 6px;
	border-radius: var(--wclp-radius);
	background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0)), var(--wclp-primary);
	color: #fff;
	font-family: var(--wclp-font);
	font-size: 16px;
	font-weight: 600;
	letter-spacing: .2px;
	cursor: pointer;
	box-shadow: 0 8px 18px var(--wclp-primary-40), inset 0 -3px 0 rgba(0, 0, 0, .14), inset 0 1px 0 rgba(255, 255, 255, .25);
	transition: transform .12s, filter .2s, box-shadow .2s;
	box-sizing: border-box;
	text-align: center;
}
#wclp-modal .wclp-view[data-view="register"] .wclp-btn,
#wclp-modal .wclp-view[data-view="forgot"] .wclp-btn,
#wclp-modal .wclp-view[data-view="reset"] .wclp-btn { margin-top: 10px; }
#wclp-modal .wclp-btn:hover { filter: brightness(1.06); }
#wclp-modal .wclp-btn:active { transform: translateY(1px); box-shadow: 0 4px 10px var(--wclp-primary-30), inset 0 -1px 0 rgba(0, 0, 0, .14); }
#wclp-modal .wclp-btn:focus-visible { outline: 3px solid var(--wclp-primary-40); outline-offset: 2px; }
#wclp-modal .wclp-btn.is-loading { pointer-events: none; }
#wclp-modal .wclp-btn.is-loading span { opacity: 0; }
#wclp-modal .wclp-btn.is-loading::after {
	content: '';
	position: absolute;
	width: 20px;
	height: 20px;
	border: 2.5px solid rgba(255, 255, 255, .35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: wclpSpin .7s linear infinite;
}
@keyframes wclpSpin { to { transform: rotate(360deg); } }

/* ---------- Alerts ---------- */
#wclp-modal .wclp-alert {
	margin: 0 0 14px;
	padding: 11px 14px;
	border-radius: 12px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.45;
	animation: wclpFade .2s ease;
}
#wclp-modal .wclp-alert[hidden] { display: none; }
#wclp-modal .wclp-alert.is-error { background: var(--wclp-primary-10); color: var(--wclp-error-text); border: 1px solid var(--wclp-primary-30); }
#wclp-modal .wclp-alert.is-success { background: var(--wclp-secondary-10); color: var(--wclp-secondary); border: 1px solid var(--wclp-secondary-30); }

/* ---------- Footer ---------- */
#wclp-modal .wclp-footer {
	padding: 22px 24px 26px;
	border-top: 1px solid var(--wclp-line);
	text-align: center;
}
#wclp-modal .wclp-footer p {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--wclp-text);
}
#wclp-modal .wclp-footer .wclp-link { color: var(--wclp-primary); }
#wclp-modal .wclp-footer p[hidden] { display: none; }

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
	#wclp-modal .wclp-dialog { border-radius: 24px; }
	#wclp-modal .wclp-header { padding: 16px 16px 14px 22px; }
	#wclp-modal .wclp-body { padding: 22px 20px; }
	#wclp-modal .wclp-title { font-size: 20px; }
	#wclp-modal .wclp-field input,
	#wclp-modal .wclp-field select { font-size: 16px; } /* stops iOS zoom */
}

@media (prefers-reduced-motion: reduce) {
	#wclp-modal, #wclp-modal * { transition: none !important; animation: none !important; }
}
