/**
 * FOLO passwordless sign-in (M06-auth): dialog and inline variants.
 *
 * Light palette from the theme's custom properties (with fallbacks), RTL
 * logical properties, 16px inputs (no iOS zoom), tap targets of 44px and
 * no horizontal overflow at 360px. Input selectors carry [type] so they beat
 * the theme's `.woocommerce input[type=…]` rules on WooCommerce pages.
 */

.folo-otp {
	--o-surface: var(--f-surface, #fff);
	--o-surface-2: var(--f-surface-2, #f1f1ee);
	--o-field: #f8f8f6;
	--o-line: var(--f-line-2, rgba(20, 20, 20, .14));
	--o-line-1: var(--f-line, rgba(20, 20, 20, .08));
	--o-text: var(--f-text, #141414);
	--o-soft: var(--f-soft, rgba(20, 20, 20, .72));
	--o-mute: var(--f-mute, rgba(20, 20, 20, .55));
	--o-ok: var(--f-ok, #16a34a);
	--o-bad: #c8102e;
	--o-cta: var(--f-cta-bg, #e91532);
	--o-cta-text: var(--f-cta-text, #fff);
	--o-cta-hover: var(--f-cta-hover, #ff3651);
	--o-wa: #128c4a;
	--o-ring: 0 0 0 3px rgba(var(--f-tint-rgb, 20, 20, 20), .1);

	position: relative;
	color: var(--o-text);
	font-size: 15px;
	line-height: 1.6;
	text-align: start;
	overflow-wrap: anywhere;
}

.folo-otp *,
.folo-otp *::before,
.folo-otp *::after { box-sizing: border-box; }

.folo-otp [hidden] { display: none !important; }

.folo-otp p { margin: 0; }

/* --- Head ---------------------------------------------------------------- */

.folo-otp__head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-block-end: 16px;
}

.folo-otp__avatar {
	width: 44px;
	height: 44px;
	flex: none;
	display: grid;
	place-items: center;
	border: 1px solid var(--o-line);
	border-radius: 50%;
	color: var(--o-text);
}

.folo-otp__titles { flex: 1; min-width: 0; }

.folo-otp .folo-otp__title { font-size: 17px; font-weight: 800; line-height: 1.35; }

.folo-otp .folo-otp__sub { margin-block-start: 2px; color: var(--o-mute); font-size: 12.5px; line-height: 1.5; }

.folo-otp .folo-otp__close {
	width: 44px;
	height: 44px;
	flex: none;
	display: grid;
	place-items: center;
	margin-inline-end: -8px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 50%;
	color: var(--o-text);
	font: inherit;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.folo-otp .folo-otp__close:hover { background: var(--o-surface-2); }

.folo-otp .folo-otp__reason {
	margin-block-end: 14px;
	padding: 9px 12px;
	background: rgba(var(--f-accent-rgb, 233, 21, 50), .07);
	border-radius: 10px;
	color: var(--o-text);
	font-size: 13.5px;
	font-weight: 700;
}

.folo-otp .folo-otp__flash {
	margin-block-end: 12px;
	padding: 9px 12px;
	background: var(--o-ok);
	border-radius: 10px;
	color: #fff;
	font-size: 13.5px;
	font-weight: 700;
}

/* --- Channel tabs ---------------------------------------------------------- */

.folo-otp__tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px;
	margin-block-end: 10px;
	padding: 4px;
	background: var(--o-surface-2);
	border-radius: 12px;
}

.folo-otp .folo-otp__tab {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 6px 10px;
	background: transparent;
	border: 0;
	border-radius: 9px;
	color: var(--o-soft);
	font: inherit;
	font-size: 14.5px;
	font-weight: 700;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.folo-otp .folo-otp__tab[aria-selected="true"] {
	background: var(--o-surface);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
	color: var(--o-text);
}

.folo-otp .folo-otp__tab[data-channel="whatsapp"] svg { color: var(--o-wa); }

.folo-otp .folo-otp__last {
	width: 100%;
	min-height: 40px;
	margin-block-end: 6px;
	padding: 6px 10px;
	background: none;
	border: 1px dashed var(--o-line);
	border-radius: 10px;
	color: var(--o-soft);
	font: inherit;
	font-size: 13px;
	text-align: center;
	cursor: pointer;
}

.folo-otp .folo-otp__last bdi { font-weight: 700; unicode-bidi: isolate; }

/* --- Fields ---------------------------------------------------------------- */

.folo-otp .folo-otp__pane { margin-block-start: 8px; }

.folo-otp .folo-otp__label {
	display: block;
	margin-block-end: 7px;
	color: var(--o-text);
	font-size: 14px;
	font-weight: 700;
}

.folo-otp input.folo-otp__input[type],
.folo-otp input.folo-otp__box[type] {
	width: 100%;
	margin: 0;
	background: var(--o-field);
	border: 1px solid var(--o-line);
	border-radius: 10px;
	box-shadow: none;
	color: var(--o-text);
	font: inherit;
	font-size: 16px;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.folo-otp input.folo-otp__input[type] {
	height: 52px;
	padding: 0 14px;
	text-align: left;
	direction: ltr;
}

.folo-otp input.folo-otp__input[type]::placeholder { color: var(--o-mute); opacity: .8; }

.folo-otp input.folo-otp__input[type]:focus,
.folo-otp input.folo-otp__box[type]:focus {
	outline: none;
	background: var(--o-surface);
	border-color: var(--o-text);
	box-shadow: var(--o-ring);
}

/* Phone: ONE field — the country prefix sits inside it. */
.folo-otp__phone {
	display: flex;
	align-items: stretch;
	height: 52px;
	background: var(--o-field);
	border: 1px solid var(--o-line);
	border-radius: 10px;
	direction: ltr;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.folo-otp__phone:focus-within {
	background: var(--o-surface);
	border-color: var(--o-text);
	box-shadow: var(--o-ring);
}

.folo-otp .folo-otp__phone input.folo-otp__input[type] {
	flex: 1;
	min-width: 0;
	height: 100%;
	padding-inline: 12px 14px;
	background: transparent;
	border: 0;
	border-radius: 0 10px 10px 0;
	box-shadow: none;
	letter-spacing: .02em;
}

.folo-otp .folo-otp__cc {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-width: 44px;
	padding: 0 10px 0 12px;
	background: transparent;
	border: 0;
	border-inline-end: 1px solid var(--o-line-1);
	border-radius: 10px 0 0 10px;
	color: var(--o-text);
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	direction: ltr;
}

.folo-otp .folo-otp__cc:hover { background: rgba(var(--f-tint-rgb, 20, 20, 20), .04); }

.folo-otp .folo-otp__cc:focus-visible { outline: 2px solid var(--o-text); outline-offset: -2px; }

.folo-otp .folo-otp__cc.is-static { cursor: default; }

.folo-otp .folo-otp__cc.is-static:hover { background: transparent; }

.folo-otp .folo-otp__flag { font-size: 19px; line-height: 1; }

.folo-otp .folo-otp__caret { color: var(--o-mute); font-size: 12px; }

.folo-otp .folo-otp__cclist {
	margin-block-start: 6px;
	background: var(--o-surface);
	border: 1px solid var(--o-line);
	border-radius: 10px;
	box-shadow: 0 10px 26px rgba(0, 0, 0, .08);
	overflow: hidden;
}

.folo-otp input.folo-otp__ccsearch[type] {
	display: block;
	width: 100%;
	height: 44px;
	margin: 0;
	padding: 0 12px;
	background: var(--o-field);
	border: 0;
	border-block-end: 1px solid var(--o-line-1);
	border-radius: 0;
	color: var(--o-text);
	font: inherit;
	font-size: 16px;
}

.folo-otp .folo-otp__ccitems {
	max-height: 232px;
	margin: 0;
	padding: 4px;
	overflow-y: auto;
	list-style: none;
	overscroll-behavior: contain;
}

.folo-otp .folo-otp__ccitems li {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	margin: 0;
	padding: 6px 10px;
	border-radius: 8px;
	cursor: pointer;
}

.folo-otp .folo-otp__ccitems li:hover,
.folo-otp .folo-otp__ccitems li:focus { background: var(--o-surface-2); outline: none; }

.folo-otp .folo-otp__ccitems li[aria-selected="true"] { font-weight: 700; }

.folo-otp .folo-otp__ccname { flex: 1; min-width: 0; }

.folo-otp .folo-otp__cccode { color: var(--o-mute); font-size: 14px; }

.folo-otp .folo-otp__ccnone { padding: 12px; color: var(--o-mute); font-size: 13px; text-align: center; }

.folo-otp .folo-otp__hint { margin-block-start: 7px; color: var(--o-mute); font-size: 12.5px; }

.folo-otp .folo-otp__error {
	margin-block-start: 10px;
	color: var(--o-bad);
	font-size: 13.5px;
	font-weight: 700;
}

/* --- Buttons ---------------------------------------------------------------- */

.folo-otp .folo-otp__btn {
	position: relative;
	width: 100%;
	min-height: 52px;
	margin-block-start: 14px;
	padding: 12px 16px;
	background: var(--o-cta);
	border: 0;
	border-radius: 10px;
	box-shadow: none;
	color: var(--o-cta-text);
	font: inherit;
	font-size: 15.5px;
	font-weight: 800;
	line-height: 1.4;
	cursor: pointer;
	transition: background .15s ease, opacity .15s ease;
}

@media (hover: hover) {
	.folo-otp .folo-otp__btn:hover { background: var(--o-cta-hover); }
}

.folo-otp .folo-otp__btn:focus-visible { outline: 3px solid rgba(var(--f-accent-rgb, 233, 21, 50), .35); outline-offset: 2px; }

.folo-otp .folo-otp__btn.is-busy { opacity: .9; cursor: progress; }

.folo-otp .folo-otp__btn.is-busy::before {
	content: "";
	display: inline-block;
	width: 15px;
	height: 15px;
	margin-inline-end: 8px;
	vertical-align: -2px;
	border: 2px solid rgba(255, 255, 255, .4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: folo-otp-spin .7s linear infinite;
}

@keyframes folo-otp-spin { to { transform: rotate(360deg); } }

.folo-otp .folo-otp__link {
	min-height: 44px;
	padding: 10px 6px;
	background: none;
	border: 0;
	color: var(--o-text);
	font: inherit;
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.folo-otp .folo-otp__consent {
	margin-block-start: 12px;
	color: var(--o-mute);
	font-size: 12px;
	line-height: 1.7;
	text-align: center;
}

.folo-otp .folo-otp__consent a { color: var(--o-soft); text-decoration: underline; text-underline-offset: 2px; }

/* --- Code step ---------------------------------------------------------------- */

.folo-otp .folo-otp__lead { color: var(--o-soft); font-size: 14px; text-align: center; }

.folo-otp .folo-otp__target {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 2px 10px;
	margin-block: 2px 8px;
}

.folo-otp .folo-otp__masked { font-size: 16px; font-weight: 800; unicode-bidi: isolate; }

.folo-otp .folo-otp__change { color: var(--o-mute); font-size: 13px; }

.folo-otp .folo-otp__note {
	margin-block-end: 10px;
	padding: 8px 12px;
	background: rgba(217, 119, 6, .1);
	border-radius: 10px;
	color: #92400e;
	font-size: 13px;
	font-weight: 700;
	text-align: center;
}

.folo-otp .folo-otp__wa {
	display: grid;
	justify-items: center;
	gap: 6px;
	margin-block-end: 14px;
}

.folo-otp .folo-otp__open {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 8px 18px;
	border: 1.5px solid var(--o-wa);
	border-radius: 999px;
	color: var(--o-wa);
	font-size: 14.5px;
	font-weight: 800;
	text-decoration: none;
}

.folo-otp .folo-otp__open:hover { background: rgba(18, 140, 74, .06); }

.folo-otp .folo-otp__from { color: var(--o-mute); font-size: 12.5px; }

.folo-otp .folo-otp__from bdi { unicode-bidi: isolate; }

.folo-otp__boxes {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 8px;
	direction: ltr;
}

.folo-otp input.folo-otp__box[type] {
	height: 56px;
	padding: 0;
	font-size: 24px;
	font-weight: 800;
	text-align: center;
	caret-color: var(--o-cta);
}

.folo-otp .folo-otp__paste {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin: 10px auto 0;
	padding: 8px 16px;
	background: var(--o-surface);
	border: 1px solid var(--o-line);
	border-radius: 999px;
	color: var(--o-text);
	font: inherit;
	font-size: 13.5px;
	font-weight: 700;
	cursor: pointer;
}

.folo-otp .folo-otp__resend {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin-block-start: 6px;
	color: var(--o-mute);
	font-size: 13px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.folo-otp .folo-otp__help {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0 12px;
	padding-block-start: 10px;
	border-block-start: 1px solid var(--o-line-1);
	color: var(--o-mute);
	font-size: 12.5px;
	text-align: center;
}

.folo-otp .folo-otp__helptext { flex-basis: 100%; }

.folo-otp .folo-otp__help .folo-otp__link { font-size: 12.5px; }

.folo-otp .folo-otp__support {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	color: var(--o-wa);
	font-weight: 700;
	text-decoration: none;
}

.folo-otp .folo-otp__ts:not(:empty) { display: flex; justify-content: center; margin-block-start: 12px; }

/* --- Done ---------------------------------------------------------------- */

.folo-otp .folo-otp__done {
	display: grid;
	justify-items: center;
	gap: 10px;
	padding-block: 18px 8px;
	text-align: center;
}

.folo-otp .folo-otp__doneicon {
	width: 58px;
	height: 58px;
	display: grid;
	place-items: center;
	background: var(--o-ok);
	border-radius: 50%;
	color: #fff;
}

.folo-otp .folo-otp__donetext { font-size: 16px; font-weight: 800; }

/* --- As a dialog -------------------------------------------------------------- */

.folo-otp-overlay {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: grid;
	place-items: center;
	padding: 16px;
}

.folo-otp-overlay[hidden] { display: none; }

.folo-otp-overlay__scrim {
	position: absolute;
	inset: 0;
	background: rgba(20, 20, 20, .45);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	opacity: 0;
	transition: opacity .2s ease;
}

.folo-otp-overlay__panel {
	position: relative;
	width: min(420px, 100%);
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	padding: 18px 20px 20px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--f-surface, #fff);
	border: 1px solid var(--f-line, rgba(20, 20, 20, .08));
	border-radius: 16px;
	box-shadow: var(--f-sh-lg, 0 26px 70px rgba(0, 0, 0, .16));
	opacity: 0;
	transform: translateY(14px) scale(.98);
	transition: opacity .2s ease, transform .28s cubic-bezier(.22, 1, .36, 1);
}

.folo-otp-overlay__panel:focus { outline: none; }

.folo-otp-overlay.is-open .folo-otp-overlay__scrim { opacity: 1; }
.folo-otp-overlay.is-open .folo-otp-overlay__panel { opacity: 1; transform: none; }

html.folo-otp-lock { overflow: hidden; }

/* Phones: open near the top so the rising keyboard never hides the field. */
@media (max-width: 600px) {
	.folo-otp-overlay { place-items: start center; padding: max(56px, env(safe-area-inset-top)) 12px 12px; }

	.folo-otp-overlay__panel { max-height: calc(100vh - 68px); max-height: calc(100dvh - 68px); padding: 16px 16px 18px; }
}

@media (max-width: 360px) {
	.folo-otp__boxes { gap: 6px; }

	.folo-otp input.folo-otp__box[type] { height: 52px; font-size: 22px; }
}

/* --- Inline (My Account, order-pay / order-received) ------------------------- */

.folo-otp-inline {
	max-width: 440px;
	margin: 0 auto 24px;
	padding: 20px;
	background: var(--f-surface, #fff);
	border: 1px solid var(--f-line, rgba(20, 20, 20, .08));
	border-radius: 16px;
	box-shadow: var(--f-sh-sm, 0 2px 10px rgba(0, 0, 0, .06));
}

.folo-otp-login--global { margin-block: 8px 24px; }

.folo-otp-login--global > p { max-width: 440px; margin: 0 auto 12px; }

.folo-otp-noscript { margin: 0; color: var(--f-soft, #444); text-align: center; }

@media (max-width: 360px) {
	.folo-otp-inline { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.folo-otp-overlay__scrim,
	.folo-otp-overlay__panel,
	.folo-otp .folo-otp__tab { transition: none; }

	.folo-otp .folo-otp__btn.is-busy::before { animation-duration: 2s; }
}
