/*
Phone/OTP login modal. Brand colors default to the theme's own design
tokens (assets/css/tokens.css) but are re-declared here, scoped to the
modal, so they can be tuned for this one component without touching the
site-wide palette.
*/

#new-ubit-otp-modal {
	--notl-primary: var(--color-primary, #0f29e8);
	--notl-primary-hover: var(--color-primary-hover, #0c20b8);
	--notl-ink: var(--color-ink, #18181b);
	--notl-muted: var(--color-muted, #6b7280);
	--notl-border: var(--color-border, #e4e4e7);
	--notl-error: #d92d20;
	--notl-error-tint: #fef3f2;
	--notl-success: var(--color-success, #15803d);
	--notl-success-tint: #f0fdf4;
	--notl-radius: var(--radius-md, 10px);

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-4, 1rem);
	background: rgb(4 11 60 / 78%);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

#new-ubit-otp-modal[hidden] {
	display: none;
}

#new-ubit-otp-modal .notl-panel {
	width: 100%;
	max-width: 400px;
	max-height: calc(100vh - 2rem);
	overflow-y: auto;
	background: #fff;
	border-radius: var(--notl-radius);
	box-shadow: var(--shadow-sm, 0 10px 40px rgb(0 0 0 / 0.2));
	position: relative;
	padding: 2rem 1.5rem 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	transform: scale(0.96) translateY(8px);
	opacity: 0;
	transition: transform var(--transition-base, 200ms ease), opacity var(--transition-base, 200ms ease);
    overflow: hidden;
}

#new-ubit-otp-modal.is-open .notl-panel {
	transform: scale(1) translateY(0);
	opacity: 1;
}

.notl-close {
	position: absolute;
	top: 18px;
	inset-inline-end: 19px;
	width: 32px;
	height: 32px;
	border: 0;
	background: transparent;
	border-radius: var(--radius-full, 999px);
	font-size: 22px;
	line-height: 1;
	color: var(--notl-muted);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background var(--transition-fast, 150ms ease), color var(--transition-fast, 150ms ease);
}

.notl-close:hover {
	background: var(--notl-border);
	color: var(--notl-ink);
}

.notl-brand {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.5rem;
}

.notl-brand img,
.notl-brand svg {
	max-width: 160px;
	height: auto;
}

.notl-brand h2 {
	margin: 0;
	font-size: var(--text-lg, 1.1rem);
	font-weight: var(--font-semibold, 600);
	color: var(--notl-ink);
}

.notl-lede {
	margin: 0 0 1rem;
	/* text-align: center; */
	color: var(--notl-muted);
	font-size: var(--text-sm, 0.875rem);
}

.notl-step {
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.notl-step[hidden] {
	/* Same specificity as the UA's [hidden] rule, and author CSS wins that
	   tie -- without this, .notl-step's own display:flex would win instead
	   and the "hidden" step would render visible anyway. */
	display: none;
}

.notl-field {
	position: relative;
	/* Matches the input's own direction below -- without this, a leading/
	   trailing icon positioned with inset-inline-start/end resolves against
	   the page's RTL instead of the LTR text it needs to sit next to,
	   landing on the wrong side and overlapping whatever's typed. */
	direction: ltr;
}

.notl-field input {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 14px 8px;
	height: 54px;
	border: 1px solid var(--notl-border);
	border-radius: 8px;
	font-size: 16px;
	text-align: left;
	direction: ltr;
	color: var(--notl-ink);
	transition: border-color var(--transition-fast, 150ms ease);
}

/* Neutralize the browser's autofill background (Chrome forces a yellow/
   blue tint via internal UA styles that a plain background-color can't
   override) -- the inset box-shadow trick is the standard workaround. */
.notl-field input:-webkit-autofill,
.notl-field input:-webkit-autofill:hover,
.notl-field input:-webkit-autofill:focus {
	-webkit-box-shadow: 0 0 0 1000px #fff inset;
	-webkit-text-fill-color: var(--notl-ink);
	transition: background-color 999999s ease-in-out 0s;
}

.notl-field input:focus {
	outline: none;
	border-color: var(--notl-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--notl-primary) 15%, transparent);
}

.notl-field label {
	position: absolute;
	top: 50%;
	inset-inline-end: 14px;
	transform: translateY(-50%);
	background: #fff;
	padding: 0 4px;
	color: var(--notl-muted);
	font-size: var(--text-sm, 0.875rem);
	pointer-events: none;
	transition: all var(--transition-fast, 150ms ease);
}

.notl-field input:focus + label,
.notl-field input:not(:placeholder-shown) + label {
	top: 0;
	font-size: 11px;
	color: #8d8d8d;
}

/* Leading icon (email/phone) --------------------------------------------------- */

.notl-field--icon input {
	padding-inline-start: 44px;
}

.notl-field--icon label {
}

.notl-field-icon {
	position: absolute;
	top: 0;
	bottom: 0;
	inset-inline-start: 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	color: var(--notl-muted);
	pointer-events: none;
}

.notl-field-icon .icon {
	width: 20px;
	height: 20px;
}

.notl-otp-boxes {
	display: flex;
	flex-direction: row-reverse;
	gap: 8px;
	justify-content: center;
}

.notl-otp-box {
	width: 44px;
	height: 52px;
	text-align: center;
	font-size: 20px;
	font-weight: var(--font-semibold, 600);
	border: 1px solid var(--notl-border);
	border-radius: 8px;
	color: var(--notl-ink);
	transition: border-color var(--transition-fast, 150ms ease), box-shadow var(--transition-fast, 150ms ease);
}

.notl-otp-box:focus {
	outline: none;
	border-color: var(--notl-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--notl-primary) 15%, transparent);
}

.notl-timer {
	margin: -0.5rem 0 0;
	text-align: center;
	font-size: var(--text-xs, 0.75rem);
	color: var(--notl-muted);
	font-variant-numeric: tabular-nums;
}

.notl-btn {
	border: 0;
	border-radius: 8px;
	font-size: var(--text-base, 1rem);
	font-weight: var(--font-semibold, 600);
	cursor: pointer;
	transition: background var(--transition-fast, 150ms ease), opacity var(--transition-fast, 150ms ease);
}

.notl-btn--primary {
	width: 100%;
	padding: 13px;
	background: var(--notl-primary);
	color: #fff;
	text-align: center;
}

.notl-btn--primary:hover {
	background: var(--notl-primary-hover);
}

.notl-btn--primary:disabled,
.notl-btn--primary.is-loading {
	opacity: 0.65;
	cursor: not-allowed;
}

.notl-btn--primary.is-loading {
	position: relative;
	color: transparent;
}

.notl-btn--primary.is-loading::after {
	content: '';
	position: absolute;
	inset: 0;
	margin: auto;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid rgb(255 255 255 / 0.5);
	border-top-color: #fff;
	animation: notl-spin 0.7s linear infinite;
}

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

.notl-otp-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.notl-btn--link {
	background: transparent;
	padding: 4px 2px;
	color: var(--notl-primary);
	font-size: var(--text-xs, 0.8125rem);
	font-weight: var(--font-medium, 500);
}

.notl-btn--link:hover:not(:disabled) {
	text-decoration: underline;
}

.notl-btn--link:disabled {
	color: var(--notl-muted);
	cursor: not-allowed;
}

#notl-status {
	margin: 0;
	min-height: 1px;
	text-align: center;
	font-size: var(--text-sm, 0.875rem);
}

#notl-status:empty {
	display: none;
}

#notl-status.is-error {
	color: var(--notl-error);
	background: var(--notl-error-tint);
	padding: 8px 10px;
	border-radius: 8px;
}

#notl-status.is-success {
	color: var(--notl-success);
	background: var(--notl-success-tint);
	padding: 8px 10px;
	border-radius: 8px;
}

/* Tabs (password login vs. phone/OTP) --------------------------------------- */

.notl-tabs {
	display: flex;
	gap: 4px;
	padding: 4px;
	background: var(--notl-border);
	border-radius: 10px;
}

.notl-tab {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex: 1;
	border: 0;
	padding: 10px 8px;
	background: transparent;
	border-radius: 7px;
	color: var(--notl-muted);
	font-size: var(--text-xs, 0.8125rem);
	font-weight: var(--font-medium, 500);
	cursor: pointer;
	transition: background var(--transition-fast, 150ms ease), color var(--transition-fast, 150ms ease);
}

.notl-tab .icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.notl-tab.is-active {
	background: #fff;
	color: var(--notl-ink);
	box-shadow: 0 1px 2px rgb(24 24 27 / 0.08);
}

.notl-tab-panel[hidden] {
	/* Same specificity note as .notl-step[hidden] above. */
	display: none;
}

#notl-password-form {
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

/* Password field's show/hide toggle ------------------------------------------ */

.notl-field--password input {
	padding-inline-start: 44px;
}

.notl-password-toggle {
	position: absolute;
	top: 0;
	bottom: 0;
	inset-inline-start: 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	border: 0;
	background: transparent;
	color: var(--notl-muted);
	cursor: pointer;
}

.notl-password-toggle:hover {
	color: var(--notl-ink);
}

.notl-password-toggle .icon {
	width: 20px;
	height: 20px;
}

/* Forgot-password link + remember-me ------------------------------------------ */

.notl-password-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: -0.5rem;
	font-size: var(--text-xs, 0.8125rem);
}

.notl-remember {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--notl-muted);
	cursor: pointer;
	white-space: nowrap;
	display: none;
}

.notl-remember input {
	accent-color: var(--notl-primary);
	width: 16px;
	height: 16px;
}

#notl-password-status {
	margin: 0;
	min-height: 1px;
	text-align: center;
	font-size: var(--text-sm, 0.875rem);
}

#notl-password-status:empty {
	display: none;
}

#notl-password-status.is-error {
	color: var(--notl-error);
	background: var(--notl-error-tint);
	padding: 8px 10px;
	border-radius: 8px;
}

#notl-password-status.is-success {
	color: var(--notl-success);
	background: var(--notl-success-tint);
	padding: 8px 10px;
	border-radius: 8px;
}

.notl-rules {
	/* margin: 20px 0 0; */
	text-align: center;
	font-size: 11px;
	font-weight: var(--font-regular, 400);
	color: #6b7280e0;
}

.notl-tab-panel {
    padding-top: 16px;
}


@media (max-width: 480px) {
	.notl-otp-box {
		width: 40px;
		height: 48px;
		font-size: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	#new-ubit-otp-modal .notl-panel {
		transition: none;
	}
}
