/* ============================================================
   CEV Smart Form — front-end styles (Phase 2).
   ------------------------------------------------------------
   Login + Register markup for the four templates + tab switching.
   Everything is scoped under .cev-smart-form so theme styles don't
   bleed in. Theme tokens are CSS vars so the Customizer (Phase 8)
   can override them.
   ============================================================ */

.cev-smart-form {
	--cev-sf-brand: #4f46e5;
	--cev-sf-brand-hover: #4338ca;
	--cev-sf-on-brand: #ffffff;
	--cev-sf-text: #0f172a;
	--cev-sf-muted: #64748b;
	--cev-sf-border: #e2e8f0;
	--cev-sf-surface: #ffffff;
	--cev-sf-track: #f1f5f9;
	--cev-sf-radius: 14px;
	--cev-sf-radius-sm: 9px;

	box-sizing: border-box;
	width: 100%;
	max-width: 460px;
	margin: 0 auto;
	color: var(--cev-sf-text);
	font-size: 15px;
	line-height: 1.5;
}

.cev-smart-form *,
.cev-smart-form *::before,
.cev-smart-form *::after {
	box-sizing: border-box;
}

/* ---- Card ---- */
.cev-smart-form .cev-sf-card {
	background: var(--cev-sf-surface);
	border: 1px solid var(--cev-sf-border);
	border-radius: var(--cev-sf-radius);
	padding: 30px 30px 32px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 28px rgba(15, 23, 42, 0.06);
}

/* ---- Tabs ---- */
.cev-smart-form .cev-sf-tabs {
	display: flex;
	gap: 4px;
	padding: 4px;
	margin-bottom: 22px;
	background: var(--cev-sf-track);
	border-radius: var(--cev-sf-radius-sm);
}

.cev-smart-form .cev-sf-tabs--center {
	max-width: 280px;
	margin-inline: auto;
}

.cev-smart-form .cev-sf-tab {
	flex: 1;
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: transparent;
	padding: 10px 14px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--cev-sf-muted);
	border-radius: 7px;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.cev-smart-form .cev-sf-tab:hover {
	color: var(--cev-sf-text);
}

.cev-smart-form .cev-sf-tab:focus {
	outline: none;
}

.cev-smart-form .cev-sf-tab:focus-visible {
	outline: 2px solid var(--cev-sf-brand);
	outline-offset: 2px;
}

.cev-smart-form .cev-sf-tab.is-active {
	background: var(--cev-sf-surface);
	color: var(--cev-sf-brand);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.10), 0 0 0 1px rgba(15, 23, 42, 0.04);
}

/* ---- Panels ---- */
.cev-smart-form .cev-sf-panel {
	display: none;
}

.cev-smart-form .cev-sf-panel.is-active {
	display: block;
}

/* ---- Fields ---- */
.cev-smart-form .cev-sf-form {
	margin: 0;
}

.cev-smart-form .cev-sf-field {
	margin-bottom: 16px;
}

.cev-smart-form .cev-sf-label {
	display: block;
	margin-bottom: 7px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: #334155;
}

.cev-smart-form .cev-sf-input {
	width: 100%;
	height: 46px;
	padding: 0 14px;
	appearance: none;
	-webkit-appearance: none;
	font-family: inherit;
	font-size: 15px;
	color: var(--cev-sf-text);
	background: var(--cev-sf-surface);
	border: 1px solid var(--cev-sf-border);
	border-radius: var(--cev-sf-radius-sm);
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cev-smart-form .cev-sf-input::placeholder {
	color: #9aa6b6;
}

/* International phone input (intl-tel-input) — make the wrapper span the field
   width so the flag/dial-code selector + input fill the row. The library's own
   stylesheet handles the flags, dropdown, and dial-code spacing. */
.cev-smart-form .iti {
	width: 100%;
	display: block;
}

.cev-smart-form .cev-sf-input:hover {
	border-color: #cbd5e1;
}

.cev-smart-form .cev-sf-input:focus {
	border-color: var(--cev-sf-brand);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.cev-smart-form .cev-sf-input.cev-sf-invalid {
	border-color: #e11d48;
	box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

/* ---- Required marker + validation message ---- */
.cev-smart-form .cev-sf-req {
	margin-left: 2px;
	color: #e11d48;
	font-weight: 700;
}

.cev-smart-form .cev-sf-optional {
	margin-left: 4px;
	font-weight: 400;
	font-size: 12px;
	color: var(--cev-sf-muted, #6b7280);
}

.cev-smart-form .cev-sf-error {
	display: none;
	margin-top: 6px;
	font-size: 12px;
	line-height: 1.4;
	color: #e11d48;
}

.cev-smart-form .cev-sf-field--invalid .cev-sf-error {
	display: block;
}

.cev-smart-form .cev-sf-field--invalid .cev-sf-input {
	border-color: #e11d48;
	box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

/* Standalone (non-field) messages — form-level errors. */
.cev-smart-form .cev-sf-error.is-shown {
	display: block;
}

/* Form-level submit errors (email exists, captcha, etc.) render as a clear
   notice banner so they stand out from the surrounding text. */
.cev-smart-form .cev-sf-form-error.is-shown {
	margin: 4px 0 14px;
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.4;
	color: #b91c1c;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-left: 3px solid #e11d48;
	border-radius: var(--cev-sf-radius-sm, 8px);
}

/* Resend link shown inside the shared OTP popup (#otp-popup) after countdown. */
#otp-popup .cev-sf-resend-link {
	color: #4f46e5;
	text-decoration: underline;
	cursor: pointer;
}

/* ---- Password field: show/hide toggle + strength meter ---- */
.cev-smart-form .cev-sf-input-wrap {
	position: relative;
}

.cev-smart-form .cev-sf-input--password {
	padding-right: 44px;
}

.cev-smart-form .cev-sf-pw-toggle {
	position: absolute;
	top: 0;
	right: 0;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
	color: var(--cev-sf-muted, #6b7280);
}

.cev-smart-form .cev-sf-pw-toggle svg {
	width: 20px;
	height: 20px;
}

.cev-smart-form .cev-sf-pw-toggle .cev-sf-eye-off {
	display: none;
}

.cev-smart-form .cev-sf-pw-toggle.is-showing .cev-sf-eye {
	display: none;
}

.cev-smart-form .cev-sf-pw-toggle.is-showing .cev-sf-eye-off {
	display: block;
}

.cev-smart-form .cev-sf-pw-meter {
	height: 6px;
	margin: 8px 0 4px;
	border-radius: 999px;
	background: #e5e7eb;
	overflow: hidden;
}

.cev-smart-form .cev-sf-pw-bar {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 999px;
	transition: width 0.2s ease, background-color 0.2s ease;
}

.cev-smart-form .cev-sf-pw-bar.is-weak {
	width: 33%;
	background: #e11d48;
}

.cev-smart-form .cev-sf-pw-bar.is-medium {
	width: 66%;
	background: #f59e0b;
}

.cev-smart-form .cev-sf-pw-bar.is-strong {
	width: 100%;
	background: #16a34a;
}

.cev-smart-form .cev-sf-pw-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
}

.cev-smart-form .cev-sf-pw-label.is-weak {
	color: #e11d48;
}

.cev-smart-form .cev-sf-pw-label.is-medium {
	color: #b45309;
}

.cev-smart-form .cev-sf-pw-label.is-strong {
	color: #16a34a;
}

/* ---- Button ---- */
.cev-smart-form .cev-sf-btn {
	display: block;
	width: 100%;
	height: 48px;
	margin-top: 18px;
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	border-radius: var(--cev-sf-radius-sm);
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.cev-smart-form .cev-sf-btn--primary {
	background: var(--cev-sf-brand);
	color: var(--cev-sf-on-brand);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), 0 6px 16px rgba(79, 70, 229, 0.22);
}

.cev-smart-form .cev-sf-btn--primary:hover {
	background: var(--cev-sf-brand-hover);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), 0 8px 20px rgba(79, 70, 229, 0.28);
}

.cev-smart-form .cev-sf-btn--primary:active {
	transform: translateY(1px);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.cev-smart-form .cev-sf-btn:focus {
	outline: none;
}

.cev-smart-form .cev-sf-btn:focus-visible {
	outline: 2px solid var(--cev-sf-brand);
	outline-offset: 2px;
}

.cev-smart-form .cev-sf-btn[disabled] {
	opacity: 0.65;
	cursor: not-allowed;
	box-shadow: none;
}

/* ---- Hint + alt link ---- */
.cev-smart-form .cev-sf-hint {
	margin: 0;
	font-size: 13px;
	color: var(--cev-sf-muted);
}

.cev-smart-form .cev-sf-alt {
	margin: 16px 0 0;
	text-align: center;
	font-size: 13px;
	color: var(--cev-sf-muted);
}

.cev-smart-form .cev-sf-link {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: none;
	padding: 0;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	color: var(--cev-sf-brand);
	cursor: pointer;
}

.cev-smart-form .cev-sf-link:hover {
	text-decoration: underline;
}

/* ---- Third-party injected rows (captcha + WC privacy text) ----
   The captcha markup is produced by whichever security / captcha plugin hooks
   the WC register/login form (or none), so these rules stay GENERIC — no
   plugin-specific selectors — and only normalise spacing so any injected
   captcha sits neatly without big internal gaps. */
.cev-smart-form .cev-sf-form p:not(.cev-sf-hint):not(.cev-sf-alt):not(.woocommerce-privacy-policy-text) {
	margin: 0 0 14px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--cev-sf-text);
}

.cev-smart-form .cev-sf-form label:not(.cev-sf-label) {
	margin: 0;
	font-weight: 400;
	font-size: 13px;
	line-height: 1.5;
	color: var(--cev-sf-text);
}

.cev-smart-form .woocommerce-privacy-policy-text {
	margin: 16px 0 0;
	font-size: 12.5px;
	line-height: 1.55;
	color: var(--cev-sf-muted);
}

.cev-smart-form .woocommerce-privacy-policy-text p {
	margin: 0;
	font-size: inherit;
	color: inherit;
}

.cev-smart-form .woocommerce-privacy-policy-text a,
.cev-smart-form .cev-sf-form p a {
	color: var(--cev-sf-brand);
}

/* Captcha (e.g. All In One WP Security) injected via the WC register/login hook —
   give its bare text input the same look as the native fields. */
.cev-smart-form .cev-sf-form input:not(.cev-sf-input):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="hidden"]) {
	height: 44px;
	max-width: 130px;
	margin-top: 6px;
	padding: 0 12px;
	appearance: none;
	-webkit-appearance: none;
	font-family: inherit;
	font-size: 15px;
	color: var(--cev-sf-text);
	background: var(--cev-sf-surface);
	border: 1px solid var(--cev-sf-border);
	border-radius: var(--cev-sf-radius-sm);
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cev-smart-form .cev-sf-form input:not(.cev-sf-input):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="hidden"]):focus {
	border-color: var(--cev-sf-brand);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* ---- Template 2 — Split / brand panel ---- */
.cev-smart-form.cev-sf--t2 {
	max-width: 760px;
}

.cev-smart-form .cev-sf-card--split {
	display: flex;
	padding: 0;
	overflow: hidden;
}

.cev-smart-form .cev-sf-brand {
	flex: 0 0 40%;
	display: flex;
	flex-direction: column;
	justify-content: var(--cev-sf-panel-justify, center);
	padding: 32px;
	background: var(--cev-sf-panel-bg, linear-gradient(150deg, var(--cev-sf-brand), #7c3aed));
	color: var(--cev-sf-panel-text, var(--cev-sf-on-brand));
}

.cev-smart-form .cev-sf-brand__content {
	display: flex;
	flex-direction: column;
}

.cev-smart-form .cev-sf-brand__tagline {
	margin: 8px 0 0;
	font-size: 14px;
	line-height: 1.45;
	opacity: 0.92;
}

.cev-smart-form .cev-sf-brand__bullets {
	list-style: none;
	margin: 16px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cev-smart-form .cev-sf-brand__bullet {
	position: relative;
	padding-inline-start: 22px;
	font-size: 13.5px;
	line-height: 1.4;
	opacity: 0.95;
}

.cev-smart-form .cev-sf-brand__bullet::before {
	content: "\2713";
	position: absolute;
	inset-inline-start: 0;
	top: 0;
	font-weight: 700;
}

.cev-smart-form .cev-sf-card--panel-right {
	flex-direction: row-reverse;
}

.cev-smart-form .cev-sf-brand__logo {
	font-size: 20px;
	font-weight: 700;
}

.cev-smart-form .cev-sf-formside {
	flex: 1;
	padding: 28px;
}

/* ---- Template 1 — Branded minimal (brand top accent + logo + underline tabs) ---- */
.cev-smart-form.cev-sf--t1 {
	max-width: 420px;
}

.cev-smart-form .cev-sf-card--minimal {
	padding: 30px 30px 32px;
	text-align: left;
	border-top: 3px solid var(--cev-sf-brand);
}

.cev-smart-form .cev-sf-logo {
	margin-bottom: 20px;
	font-size: 20px;
	font-weight: 700;
	color: var(--cev-sf-text);
}

.cev-smart-form .cev-sf-card--minimal .cev-sf-form {
	text-align: left;
}

/* Underline tabs — distinct from template 3's banner card. */
.cev-smart-form.cev-sf--t1 .cev-sf-tabs {
	justify-content: flex-start;
	gap: 24px;
	max-width: none;
	margin-bottom: 24px;
	padding: 0;
	background: transparent;
	border-bottom: 1px solid var(--cev-sf-border);
	border-radius: 0;
}

.cev-smart-form.cev-sf--t1 .cev-sf-tab {
	flex: 0 1 auto;
	padding: 10px 6px;
	margin-bottom: -1px;
	border-radius: 0;
	border-bottom: 2px solid transparent;
}

.cev-smart-form.cev-sf--t1 .cev-sf-tab.is-active {
	background: transparent;
	color: var(--cev-sf-brand);
	box-shadow: none;
	border-bottom-color: var(--cev-sf-brand);
}

/* ---- Template 3 — Brand header banner ---- */
.cev-smart-form.cev-sf--t3 {
	max-width: 440px;
}

.cev-smart-form .cev-sf-card--banner {
	padding: 0;
	overflow: hidden;
}

.cev-smart-form .cev-sf-banner {
	padding: 26px 30px;
	background: var(--cev-sf-panel-bg, linear-gradient( 135deg, var(--cev-sf-brand), #7c3aed ));
	color: var(--cev-sf-panel-text, var(--cev-sf-on-brand));
}

.cev-smart-form .cev-sf-banner .cev-sf-brand__tagline {
	margin-top: 6px;
	font-size: 13px;
}

.cev-smart-form .cev-sf-banner .cev-sf-brand__bullets {
	margin-top: 12px;
}

.cev-smart-form .cev-sf-banner__title {
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
}

.cev-smart-form .cev-sf-banner__sub {
	margin-top: 6px;
	font-size: 13px;
	opacity: 0.92;
}

.cev-smart-form .cev-sf-banner-body {
	padding: 24px 30px 30px;
}

/* ---- Phase 8 — Customizer (headings, footer) ---- */
.cev-smart-form .cev-sf-headings {
	margin-bottom: 18px;
}

.cev-smart-form .cev-sf-subheading {
	margin-top: 4px;
	font-size: 13px;
	color: var(--cev-sf-muted);
}

.cev-smart-form .cev-sf-footer {
	margin-top: 18px;
	font-size: 12.5px;
	line-height: 1.5;
	text-align: center;
	color: var(--cev-sf-muted);
}

.cev-smart-form .cev-sf-footer a {
	color: var(--cev-sf-brand);
}

/* ---- Template 4 — Side-by-side ---- */
.cev-smart-form.cev-sf--t4 {
	max-width: 820px;
}

.cev-smart-form .cev-sf-columns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
	background: var(--cev-sf-surface);
	border: 1px solid var(--cev-sf-border);
	border-radius: var(--cev-sf-radius);
	padding: 28px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.cev-smart-form .cev-sf-col--divider {
	border-inline-start: 1px solid var(--cev-sf-border);
	padding-inline-start: 32px;
}

.cev-smart-form .cev-sf-col__title {
	margin: 0 0 18px;
	font-size: 17px;
	font-weight: 700;
	color: var(--cev-sf-text);
}

.cev-smart-form.cev-sf--t4 .cev-sf-alt {
	display: none;
}

/* ---- Responsive ---- */
@media ( max-width: 640px ) {
	.cev-smart-form .cev-sf-card--split {
		flex-direction: column;
	}

	.cev-smart-form .cev-sf-brand {
		flex-basis: auto;
		padding: 24px;
	}

	.cev-smart-form .cev-sf-columns {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.cev-smart-form .cev-sf-col--divider {
		border-inline-start: 0;
		padding-inline-start: 0;
		border-top: 1px solid var(--cev-sf-border);
		padding-top: 24px;
	}
}

/* ---- Login OTP delivery-channel toggle (Phone code / Email code) ---- */
.cev-smart-form .cev-sf-channel {
	display: flex;
	gap: 4px;
	padding: 4px;
	margin-bottom: 16px;
	background: var(--cev-sf-track);
	border-radius: var(--cev-sf-radius-sm);
}

.cev-smart-form .cev-sf-channel-btn {
	flex: 1;
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: transparent;
	padding: 8px 12px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	color: var(--cev-sf-muted);
	border-radius: 7px;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.cev-smart-form .cev-sf-channel-btn:hover {
	color: var(--cev-sf-text);
}

.cev-smart-form .cev-sf-channel-btn:focus {
	outline: none;
}

.cev-smart-form .cev-sf-channel-btn:focus-visible {
	outline: 2px solid var(--cev-sf-brand);
	outline-offset: 2px;
}

.cev-smart-form .cev-sf-channel-btn.is-active {
	background: var(--cev-sf-surface);
	color: var(--cev-sf-brand);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.10), 0 0 0 1px rgba(15, 23, 42, 0.04);
}
