/* Nakshi OTP Guard — checkout widget
   Inherits the theme's font and input styling; only --nog-accent is ours. */

.nog-hidden { display: none !important; }

.nog {
	--nog-accent: #B8322F;
	--nog-ok: #1f7a3f;
	--nog-err: #b3261e;
	margin: -4px 0 18px;
	font-size: 0.95em;
	line-height: 1.45;
	clear: both;
}

.nog__row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.nog__btn {
	appearance: none;
	-webkit-appearance: none;
	border: 1.5px solid var(--nog-accent);
	background: var(--nog-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	padding: 9px 16px;
	border-radius: 6px;
	cursor: pointer;
	line-height: 1.2;
	white-space: nowrap;
	transition: opacity .15s ease, transform .05s ease;
}
.nog__btn:hover { opacity: .92; }
.nog__btn:active { transform: translateY(1px); }
.nog__btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.nog__btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--nog-accent) 35%, transparent); outline-offset: 2px; }
.nog__btn[hidden] { display: none; }

.nog__msg { flex: 1 1 200px; min-width: 0; color: inherit; opacity: .85; }
.nog__msg--info { opacity: .85; }
.nog__msg--err { color: var(--nog-err); opacity: 1; font-weight: 600; }
.nog__msg--ok { color: var(--nog-ok); opacity: 1; font-weight: 600; }

.nog__code { margin-top: 10px; }
.nog__code[hidden] { display: none; }

.nog__label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
}

.nog__input {
	font: inherit;
	font-size: 1.35em;
	letter-spacing: .35em;
	text-align: center;
	width: 8.5ch;
	min-width: 140px;
	padding: 8px 6px 8px 12px;
	border: 1.5px solid rgba(0,0,0,.28);
	border-radius: 6px;
	background: #fff;
	color: inherit;
}
.nog__input:focus { outline: none; border-color: var(--nog-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nog-accent) 22%, transparent); }

.nog__foot {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 8px;
	font-size: .92em;
	opacity: .85;
}

.nog__count { font-variant-numeric: tabular-nums; min-width: 4ch; }

.nog__link {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: var(--nog-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.nog__link:disabled { color: inherit; opacity: .5; text-decoration: none; cursor: default; }

/* Verified: the whole widget collapses to one confident line. */
.nog.is-verified .nog__row--send {
	padding: 10px 14px;
	border-radius: 6px;
	background: color-mix(in srgb, var(--nog-ok) 10%, transparent);
	border: 1px solid color-mix(in srgb, var(--nog-ok) 35%, transparent);
}
.nog.is-verified .nog__msg::before {
	content: "";
	display: inline-block;
	width: 10px; height: 10px;
	margin-right: 8px;
	border-radius: 50%;
	background: var(--nog-ok);
	vertical-align: middle;
	animation: nog-pop .35s ease-out;
}

.nog.is-busy .nog__msg--info::after {
	content: "";
	display: inline-block;
	width: .7em; height: .7em;
	margin-left: 8px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	vertical-align: -1px;
	animation: nog-spin .7s linear infinite;
}

@keyframes nog-spin { to { transform: rotate(360deg); } }
@keyframes nog-pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
	.nog *, .nog *::before, .nog *::after { animation: none !important; transition: none !important; }
}

/* Fallbacks for browsers without color-mix */
@supports not (color: color-mix(in srgb, red 10%, transparent)) {
	.nog__btn:focus-visible { outline-color: var(--nog-accent); }
	.nog__input:focus { box-shadow: 0 0 0 3px rgba(184,50,47,.22); }
	.nog.is-verified .nog__row--send { background: #eaf5ee; border-color: #b9dcc5; }
}

@media (max-width: 480px) {
	.nog__btn { width: 100%; }
	.nog__row--send .nog__msg { flex-basis: 100%; }
}

/* ---------------- OTP popup ---------------- */

.nog-modal-open { overflow: hidden; }

.nog-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
.nog-modal[hidden] { display: none; }

.nog-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 20, 24, .55);
	backdrop-filter: blur(2px);
	animation: nog-fade .18s ease-out;
}

.nog-modal__card {
	--nog-accent: #B8322F;
	--nog-ok: #1f7a3f;
	--nog-err: #b3261e;
	position: relative;
	width: 100%;
	max-width: 380px;
	background: #fff;
	border-radius: 14px;
	padding: 28px 26px 22px;
	box-shadow: 0 24px 60px rgba(0,0,0,.28);
	text-align: center;
	font-family: inherit;
	color: #1d2327;
	animation: nog-rise .22s cubic-bezier(.2,.8,.2,1);
}

.nog-modal__x {
	position: absolute;
	top: 10px; right: 12px;
	border: 0; background: none;
	font-size: 26px; line-height: 1;
	color: #9aa0a6; cursor: pointer;
	padding: 4px 8px;
}
.nog-modal__x:hover { color: #1d2327; }

.nog-modal__title { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.nog-modal__sub { margin: 0 0 18px; color: #646970; font-size: 14px; }

.nog-modal__input {
	font: inherit;
	font-size: 30px;
	font-weight: 600;
	letter-spacing: .4em;
	text-align: center;
	width: 100%;
	max-width: 240px;
	padding: 12px 8px 12px 20px;
	border: 2px solid #d5d7db;
	border-radius: 10px;
	background: #fbfbfc;
	color: #1d2327;
	margin: 0 auto 12px;
	display: block;
}
.nog-modal__input:focus {
	outline: none;
	border-color: var(--nog-accent);
	background: #fff;
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--nog-accent) 18%, transparent);
}

.nog-modal__msg { min-height: 20px; font-size: 13.5px; margin-bottom: 14px; color: #646970; }
.nog-modal__msg--info { color: #646970; }
.nog-modal__msg--err { color: var(--nog-err); font-weight: 600; }
.nog-modal__msg--ok { color: var(--nog-ok); font-weight: 700; }

.nog-modal__verify {
	appearance: none; -webkit-appearance: none;
	width: 100%;
	border: 0;
	background: var(--nog-accent);
	color: #fff;
	font: inherit; font-weight: 700; font-size: 15px;
	padding: 13px 16px;
	border-radius: 10px;
	cursor: pointer;
	transition: opacity .15s ease, transform .05s ease;
}
.nog-modal__verify:hover { opacity: .93; }
.nog-modal__verify:active { transform: translateY(1px); }
.nog-modal__verify:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.nog-modal__foot {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 14px;
	font-size: 13px;
	color: #787c82;
}
.nog-modal__count { font-variant-numeric: tabular-nums; }
.nog-modal__resend {
	border: 0; background: none; padding: 0;
	font: inherit; color: var(--nog-accent);
	text-decoration: underline; text-underline-offset: 3px;
	cursor: pointer;
}
.nog-modal__resend:disabled { color: #9aa0a6; text-decoration: none; cursor: default; }

/* Success beat: the card flashes a green ring before the order goes through. */
.nog-modal__card.is-done { box-shadow: 0 24px 60px rgba(0,0,0,.28), 0 0 0 3px var(--nog-ok) inset; }

@keyframes nog-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes nog-rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

@supports not (color: color-mix(in srgb, red 18%, transparent)) {
	.nog-modal__input:focus { box-shadow: 0 0 0 4px rgba(184,50,47,.18); }
}

@media (prefers-reduced-motion: reduce) {
	.nog-modal__backdrop, .nog-modal__card { animation: none; }
}
