/*
 * OneClick Phone Auth — advanced auth UI layer (1.0.30).
 * Loaded after auth.css. Everything is scoped to .ocpa-auth-app / .ocpa-auth-page so themes (WoodMart, Astra, …) cannot restyle it.
 * Brand colour comes from Phone Auth → Settings → Branding (--ocpa-accent); every tint is derived from it.
 */
.ocpa-auth-app,
.ocpa-auth-page,
.ocpa-modal-dialog {
	--oa: var(--ocpa-accent, #2563eb);
	--oa-dark: color-mix(in srgb, var(--oa) 80%, #000);
	--oa-soft: color-mix(in srgb, var(--oa) 9%, #fff);
	--oa-ring: color-mix(in srgb, var(--oa) 28%, transparent);
	--o-ink: #0f172a;
	--o-mute: #5b6b82;
	--o-line: #dbe3ee;
	--o-bad: #c62828;
	--o-ok: #1b7f3b;
	--o-r: 12px;
}

/* ---------- page shell ---------- */
.ocpa-auth-body { background: var(--ocpa-bg, #f6f8fb); }
body.ocpa-auth-body:not([style*="background-image"]) {
	background:
		radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, var(--ocpa-accent, #2563eb) 14%, transparent), transparent 60%),
		radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--ocpa-accent, #2563eb) 10%, transparent), transparent 60%),
		var(--ocpa-bg, #f6f8fb);
}
.ocpa-auth-page { padding: 28px 16px; }
.ocpa-auth-card {
	max-width: 460px;
	border-radius: 20px;
	padding: 34px 32px 26px;
	border: 1px solid rgba(15, 23, 42, .06);
	box-shadow: 0 24px 60px -24px rgba(15, 23, 42, .25), 0 2px 6px rgba(15, 23, 42, .04);
	position: relative;
	overflow: hidden;
}
.ocpa-auth-card::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 5px;
	background: linear-gradient(90deg, var(--oa), var(--oa-dark));
}
.ocpa-auth-logo { max-height: 60px; width: auto; max-width: 70%; margin: 4px auto 20px; }
.ocpa-auth-embed { max-width: 460px; }
.ocpa-auth-embed .ocpa-auth-app { background: #fff; border-radius: 20px; padding: 26px 26px 20px; border: 1px solid var(--o-line); box-shadow: 0 12px 34px -18px rgba(15, 23, 42, .25); }
.ocpa-modal-dialog { border-radius: 20px; padding: 28px 26px 22px; box-shadow: 0 30px 80px -20px rgba(15, 23, 42, .5); }
.ocpa-modal-close { top: 10px; right: 14px; width: 34px; height: 34px; border-radius: 50%; color: var(--o-mute); line-height: 1; }
.ocpa-modal-close:hover { background: var(--oa-soft); color: var(--oa-dark); }

/* ---------- reset theme button/input looks inside the app ---------- */
.ocpa-auth-app button,
.ocpa-auth-app input,
.ocpa-auth-app select {
	font-family: inherit;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
}
.ocpa-auth-app button:focus-visible,
.ocpa-auth-app input:focus-visible,
.ocpa-auth-app select:focus-visible,
.ocpa-auth-app a:focus-visible { outline: 3px solid var(--oa-ring); outline-offset: 2px; }

/* ---------- tabs (segmented control) ---------- */
.ocpa-auth-app .ocpa-auth-tabs { gap: 4px; padding: 4px; background: var(--oa-soft); border-radius: 14px; margin-bottom: 26px; }
.ocpa-auth-app .ocpa-tab {
	border: 0; background: transparent; color: var(--o-mute); border-radius: 10px; padding: 11px 8px;
	font-size: .95rem; font-weight: 600; min-height: 44px; line-height: 1.2; transition: background .18s, color .18s, box-shadow .18s;
}
.ocpa-auth-app .ocpa-tab:hover { color: var(--oa-dark); }
.ocpa-auth-app .ocpa-tab.is-active { background: #fff; color: var(--oa-dark); box-shadow: 0 2px 8px rgba(15, 23, 42, .12); border: 0; }

/* ---------- headings ---------- */
.ocpa-auth-app .ocpa-headline { font-size: 1.5rem; line-height: 1.25; font-weight: 700; color: var(--o-ink); margin: 0 0 6px; }
.ocpa-auth-app .ocpa-subtext { color: var(--o-mute); font-size: .95rem; line-height: 1.55; margin: 0 0 22px; }

/* ---------- fields ---------- */
.ocpa-auth-app .ocpa-field-row { margin-bottom: 18px; }
.ocpa-auth-app .ocpa-field-row > label,
.ocpa-auth-app .ocpa-otp-step > label { font-size: .86rem; font-weight: 600; color: var(--o-ink); margin-bottom: 7px; display: block; }
.ocpa-auth-app .ocpa-input,
.ocpa-auth-app .ocpa-country-select {
	height: 50px; padding: 0 14px; border: 1.5px solid var(--o-line); border-radius: var(--o-r); background: #fff; color: var(--o-ink); font-size: 1rem;
	width: 100%; box-sizing: border-box; transition: border-color .15s, box-shadow .15s;
}
.ocpa-auth-app .ocpa-input:hover { border-color: #b8c4d6; }
.ocpa-auth-app .ocpa-input:focus,
.ocpa-auth-app .ocpa-country-select:focus { outline: 0; border-color: var(--oa); box-shadow: 0 0 0 4px var(--oa-ring); }
.ocpa-auth-app .ocpa-input.is-invalid { border-color: var(--o-bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--o-bad) 18%, transparent); }
.ocpa-auth-app .ocpa-help { color: var(--o-mute); font-size: .82rem; line-height: 1.5; margin: 7px 0 0; }
.ocpa-auth-app .ocpa-field-err { color: var(--o-bad); font-size: .83rem; margin: 7px 0 0; display: flex; gap: 6px; align-items: center; }
.ocpa-auth-app .ocpa-field-err::before { content: "!"; display: inline-flex; width: 16px; height: 16px; border-radius: 50%; background: var(--o-bad); color: #fff; font-size: 11px; font-weight: 700; align-items: center; justify-content: center; flex: 0 0 16px; }

/* ---------- phone group: [flag +91 ▾ | number] ---------- */
.ocpa-phone-group { display: flex; align-items: stretch; border: 1.5px solid var(--o-line); border-radius: var(--o-r); background: #fff; transition: border-color .15s, box-shadow .15s; }
.ocpa-phone-group:focus-within { border-color: var(--oa); box-shadow: 0 0 0 4px var(--oa-ring); }
.ocpa-phone-group.is-invalid { border-color: var(--o-bad); }
.ocpa-phone-group.is-locked { background: #f4f7fb; }
.ocpa-cc { position: relative; display: flex; align-items: center; gap: 7px; padding: 0 12px 0 14px; border-right: 1.5px solid var(--o-line); cursor: pointer; min-width: 92px; background: var(--oa-soft); border-radius: calc(var(--o-r) - 2px) 0 0 calc(var(--o-r) - 2px); }
.ocpa-cc__flag { font-size: 1.15rem; line-height: 1; }
.ocpa-cc__iso { font-size: .68rem; font-weight: 800; letter-spacing: .04em; color: var(--oa-dark); background: #fff; border: 1px solid var(--o-line); border-radius: 5px; padding: 3px 5px; }
.ocpa-cc__dial { font-weight: 700; color: var(--o-ink); font-size: .98rem; }
.ocpa-cc__caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--o-mute); margin-left: 2px; }
.ocpa-cc select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; font-size: 16px; }
.ocpa-phone-group .ocpa-input { border: 0; border-radius: 0 var(--o-r) var(--o-r) 0; box-shadow: none !important; flex: 1; min-width: 0; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.ocpa-phone-group.is-locked .ocpa-cc { pointer-events: none; opacity: .75; }
.ocpa-phone-lock { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px 0 16px; padding: 10px 12px; border-radius: var(--o-r); background: var(--oa-soft); font-size: .9rem; color: var(--o-ink); }
.ocpa-phone-lock b { font-variant-numeric: tabular-nums; }
.ocpa-phone-lock button { border: 0; background: none; color: var(--oa-dark); font-weight: 700; cursor: pointer; padding: 4px 6px; text-decoration: underline; }

/* ---------- OTP boxes ---------- */
.ocpa-otp-step { margin: 4px 0 18px; padding: 18px 16px 14px; border-radius: 14px; background: var(--oa-soft); border: 1px solid color-mix(in srgb, var(--oa) 18%, #fff); }
.ocpa-otp-step[hidden] { display: none; }
.ocpa-otp-step > label { text-align: center; font-size: .95rem; margin-bottom: 12px; }
.ocpa-otp-boxes { display: flex; gap: 8px; justify-content: center; }
.ocpa-otp-boxes input {
	width: 46px; height: 56px; text-align: center; font-size: 1.5rem; font-weight: 700; color: var(--o-ink); background: #fff;
	border: 1.5px solid var(--o-line); border-radius: 12px; padding: 0; font-variant-numeric: tabular-nums; transition: border-color .12s, box-shadow .12s, transform .12s;
	-moz-appearance: textfield;
}
.ocpa-otp-boxes input:focus { outline: 0; border-color: var(--oa); box-shadow: 0 0 0 4px var(--oa-ring); transform: translateY(-1px); }
.ocpa-otp-boxes input.is-filled { border-color: var(--oa); background: #fff; }
.ocpa-otp-boxes.is-error input { border-color: var(--o-bad); animation: ocpaShake .35s; }
.ocpa-sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; pointer-events: none; }
.ocpa-otp-step .ocpa-link { display: block; margin: 12px auto 0; text-align: center; color: var(--oa-dark); font-weight: 600; }
.ocpa-otp-step .ocpa-link:disabled { color: var(--o-mute); cursor: default; font-weight: 500; }
@keyframes ocpaShake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* ---------- buttons ---------- */
.ocpa-auth-app .ocpa-btn {
	height: 50px; border-radius: var(--o-r); font-size: 1rem; font-weight: 700; width: 100%; border: 1.5px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
	cursor: pointer; transition: transform .12s, box-shadow .15s, background .15s, border-color .15s; line-height: 1; text-decoration: none; padding: 0 18px;
}
.ocpa-auth-app .ocpa-btn-primary { background: linear-gradient(180deg, var(--oa), var(--oa-dark)); color: #fff; box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--oa) 70%, #000); }
.ocpa-auth-app .ocpa-btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 22px -8px color-mix(in srgb, var(--oa) 75%, #000); color: #fff; }
.ocpa-auth-app .ocpa-btn-primary:active:not(:disabled) { transform: none; }
.ocpa-auth-app .ocpa-btn-secondary { background: #fff; color: var(--oa-dark); border-color: color-mix(in srgb, var(--oa) 45%, #fff); }
.ocpa-auth-app .ocpa-btn-secondary:hover:not(:disabled) { background: var(--oa-soft); color: var(--oa-dark); }
.ocpa-auth-app .ocpa-btn-social { background: #fff; color: var(--o-ink); border-color: var(--o-line); font-weight: 600; justify-content: center; }
.ocpa-auth-app .ocpa-btn-social:hover { background: #f7f9fc; border-color: #b8c4d6; }
.ocpa-auth-app .ocpa-btn:disabled { opacity: .65; cursor: progress; transform: none; }
.ocpa-auth-app .ocpa-btn.is-busy::before,
.ocpa-auth-app .ocpa-btn-primary:disabled::before { content: ""; width: 16px; height: 16px; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: ocpa-spin .7s linear infinite; }
.ocpa-auth-app .ocpa-link { color: var(--oa-dark); font-weight: 600; font-size: .92rem; background: none; border: 0; cursor: pointer; padding: 2px 0; }
.ocpa-auth-app .ocpa-link:hover { text-decoration: underline; }
.ocpa-auth-app .ocpa-help .ocpa-link { font-size: .9rem; }
.ocpa-auth-app .ocpa-tab-switch { text-align: center; margin-top: 22px; font-size: .92rem; color: var(--o-mute); }

/* second action stays a calm text link, not a second big button */
.ocpa-login-block + .ocpa-login-block { margin-top: 0; }
.ocpa-auth-app .ocpa-login-phone > form > .ocpa-help:last-child,
.ocpa-auth-app .ocpa-login-password > form > .ocpa-help { text-align: center; }

/* ---------- checkboxes ---------- */
.ocpa-auth-app .ocpa-checkbox-row label { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: .92rem; color: var(--o-ink); cursor: pointer; }
.ocpa-auth-app input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--oa); margin: 2px 0 0; flex: 0 0 18px; }
.ocpa-auth-app .ocpa-checkbox-row .ocpa-help { margin-left: 28px; }

/* ---------- password ---------- */
.ocpa-auth-app .ocpa-password-wrap .ocpa-input { padding-right: 46px; }
.ocpa-auth-app .ocpa-password-wrap .ocpa-toggle-password { position: absolute; top: 50%; transform: translateY(-50%); }
.ocpa-auth-app .ocpa-toggle-password { right: 6px; width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--o-mute); }
.ocpa-auth-app .ocpa-toggle-password:hover { background: var(--oa-soft); color: var(--oa-dark); }
.ocpa-auth-app .ocpa-toggle-password svg { width: 20px; height: 20px; }
.ocpa-auth-app .ocpa-password-meter { height: auto; font-size: .8rem; font-weight: 600; margin-top: 8px; }

/* ---------- social ---------- */
.ocpa-auth-app .ocpa-divider { margin: 22px 0 16px; color: var(--o-mute); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.ocpa-auth-app .ocpa-social-buttons { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 0; }
.ocpa-auth-app .ocpa-btn-social svg { width: 20px; height: 20px; flex: 0 0 20px; }
@media (min-width: 420px) { .ocpa-auth-app .ocpa-social-buttons.has-many { grid-template-columns: 1fr 1fr; } }

/* ---------- banners, toast, overlay ---------- */
.ocpa-auth-app .ocpa-banner { border-radius: var(--o-r); padding: 12px 14px; font-size: .9rem; line-height: 1.5; }
.ocpa-auth-app .ocpa-banner-warning { background: #fff8e6; border-color: #f2c76b; color: #7a4b00; }
.ocpa-toast {
	position: fixed; left: 50%; right: auto; top: auto; bottom: 22px; transform: translateX(-50%); max-width: min(92vw, 440px);
	padding: 13px 18px 13px 44px; border-radius: 14px; font-size: .93rem; font-weight: 600; line-height: 1.45; z-index: 100002; box-shadow: 0 14px 34px -10px rgba(15, 23, 42, .45); animation: ocpaToastIn .25s ease;
}
.ocpa-toast::before { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, .25); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.ocpa-toast.is-success { background: #15803d; }
.ocpa-toast.is-success::before { content: "\2713"; }
.ocpa-toast.is-error { background: #b91c1c; }
.ocpa-toast.is-error::before { content: "!"; }
@keyframes ocpaToastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.ocpa-loading-overlay { background: rgba(255, 255, 255, .72); backdrop-filter: blur(2px); }
.ocpa-spinner { border-color: var(--oa-soft); border-top-color: var(--oa); }

/* ---------- footer ---------- */
.ocpa-auth-footer { border-top: 1px solid var(--o-line); margin-top: 24px; padding-top: 16px; }

/* ---------- small screens ---------- */
@media (max-width: 480px) {
	.ocpa-auth-page { padding: 14px 10px; align-items: flex-start; }
	.ocpa-auth-card { padding: 26px 18px 20px; border-radius: 18px; }
	.ocpa-otp-boxes { gap: 6px; }
	.ocpa-otp-boxes input { width: 42px; height: 52px; font-size: 1.35rem; }
	.ocpa-auth-app .ocpa-headline { font-size: 1.3rem; }
	.ocpa-auth-embed .ocpa-auth-app { padding: 20px 16px 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.ocpa-otp-boxes.is-error input, .ocpa-toast { animation: none; }
	.ocpa-auth-app .ocpa-btn, .ocpa-otp-boxes input { transition: none; }
}

/* theme/auth.css `.ocpa-field-row label{display:block}` must not break the chip */
.ocpa-auth-app .ocpa-phone-group .ocpa-cc { display: flex !important; align-items: center; margin: 0; font-weight: 400; }
.ocpa-auth-app .ocpa-phone-group .ocpa-cc > span:first-child { display: flex !important; align-items: center; gap: 7px; }
.ocpa-cc__caret { align-self: center; }
.ocpa-auth-app .ocpa-otp-boxes input { border-radius: 12px !important; border: 1.5px solid var(--o-line) !important; background: #fff !important; height: 56px; }
.ocpa-auth-app .ocpa-otp-boxes input:focus, .ocpa-auth-app .ocpa-otp-boxes input.is-filled { border-color: var(--oa) !important; }
.ocpa-auth-app .ocpa-otp-boxes.is-error input { border-color: var(--o-bad) !important; }

/* sign-up method switch: always a side-by-side segmented pair */
.ocpa-auth-app .ocpa-method-toggle { display: flex; flex-direction: row !important; gap: 8px; margin-bottom: 20px; }
.ocpa-auth-app .ocpa-method-btn { flex: 1; height: 44px; border: 1.5px solid var(--o-line); background: #fff; color: var(--o-mute); border-radius: 10px; font-weight: 600; font-size: .92rem; cursor: pointer; padding: 0 10px; }
.ocpa-auth-app .ocpa-method-btn.is-active { background: var(--oa-soft); color: var(--oa-dark); border-color: var(--oa); }

/* compact register hero: keep the form above the fold on phones */
.ocpa-auth-hero-compact { border-radius: 14px; padding: 14px 16px; background: var(--oa-soft); border: 1px solid color-mix(in srgb, var(--oa) 16%, #fff); }
@media (max-width: 480px) {
	.ocpa-auth-hero-compact .ocpa-auth-hero__lead { display: none; }
	.ocpa-auth-hero-compact .ocpa-auth-steps { flex-direction: row !important; gap: 6px; margin: 0; }
	.ocpa-auth-hero-compact .ocpa-auth-steps__item { min-width: 0; font-size: .72rem; flex-direction: column; text-align: center; gap: 4px; }
	.ocpa-auth-hero-compact .ocpa-auth-hero__title { font-size: 1.05rem; margin-bottom: 10px; }
	.ocpa-auth-hero-compact .ocpa-auth-hero__eyebrow { margin-bottom: 4px; }
}

/* modal close button: themes (WoodMart) restyle <button>; pin it top-right as a round icon button */
.ocpa-modal-dialog .ocpa-modal-close { position: absolute !important; top: 12px !important; right: 14px !important; left: auto !important; width: 36px !important; height: 36px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 50% !important; background: #f1f5f2 !important; color: #334155 !important; font-size: 22px !important; line-height: 1 !important; display: flex !important; align-items: center; justify-content: center; z-index: 3; box-shadow: none !important; }
.ocpa-modal-dialog .ocpa-modal-close:hover { background: #e2e8e4 !important; color: #0f172a !important; }
.ocpa-modal-dialog { padding-top: 52px; }
