/*
 * Shiko WhatsApp Bot — OTP/auth form styles
 * 2.18.0 — folded from custom-auth-plugin per "no parallel plugin" rule
 *
 * Scoped to .shiko-otp-* selectors only — NO global styles (defers cap CR #5).
 * Logical properties only for RTL safety (margin-inline-*, inset-inline-*).
 * Brand tokens: --shiko-primary (#B7080A), --shiko-accent (#E40303).
 */

.shiko-otp-form {
	max-inline-size: 480px;
	margin: 0 auto;
	padding: 24px;
	background: var(--shiko-bg-secondary, #fff);
	border: 1px solid var(--shiko-border, #e5e5e2);
	border-radius: var(--shiko-radius-lg, 12px);
	font-family: var(--shiko-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.shiko-otp-title {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--shiko-text, #111);
	margin: 0 0 16px;
	line-height: 1.3;
}

.shiko-otp-step {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.shiko-otp-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--shiko-text, #111);
	margin-block-end: 4px;
}

.shiko-otp-input {
	inline-size: 100%;
	padding-block: 10px;
	padding-inline: 14px;
	border: 1px solid var(--shiko-border, #e5e5e2);
	border-radius: var(--shiko-radius, 8px);
	background: var(--shiko-input-bg, #fff);
	color: var(--shiko-text, #111);
	font-size: 15px;
	font-family: inherit;
	line-height: 1.4;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
}

.shiko-otp-input:focus,
.shiko-otp-input:focus-visible {
	border-color: var(--shiko-accent, #E40303);
	box-shadow: 0 0 0 3px rgba(228, 3, 3, 0.15);
}

.shiko-otp-otp-input {
	letter-spacing: 0.4em;
	text-align: center;
	font-size: 22px;
	font-weight: 600;
}

.shiko-otp-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-block-size: 44px;
	padding-block: 12px;
	padding-inline: 24px;
	background: var(--shiko-primary, #B7080A);
	color: #fff;
	border: 2px solid var(--shiko-primary, #B7080A);
	border-radius: var(--shiko-radius, 8px);
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	line-height: 1.4;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.shiko-otp-submit:hover,
.shiko-otp-submit:focus-visible {
	background: var(--shiko-accent, #E40303);
	border-color: var(--shiko-accent, #E40303);
}

.shiko-otp-submit:disabled,
.shiko-otp-form.is-loading .shiko-otp-submit {
	opacity: 0.6;
	cursor: not-allowed;
}

.shiko-otp-form.is-loading .shiko-otp-submit::before {
	content: "";
	inline-size: 14px;
	block-size: 14px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-block-start-color: #fff;
	border-radius: 50%;
	animation: shiko-otp-spin 0.7s linear infinite;
	margin-inline-end: 4px;
}

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

.shiko-otp-resend {
	background: transparent;
	color: var(--shiko-text-secondary, #555);
	border: 1px solid var(--shiko-border, #e5e5e2);
	padding-block: 8px;
	padding-inline: 16px;
	border-radius: var(--shiko-radius, 8px);
	font-size: 13px;
	font-family: inherit;
	cursor: pointer;
	margin-block-start: 4px;
}

.shiko-otp-resend:hover {
	border-color: var(--shiko-accent, #E40303);
	color: var(--shiko-accent, #E40303);
}

.shiko-otp-resend:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.shiko-otp-error {
	padding: 10px 12px;
	background: rgba(228, 3, 3, 0.08);
	color: var(--shiko-accent, #E40303);
	border: 1px solid rgba(228, 3, 3, 0.2);
	border-radius: var(--shiko-radius, 8px);
	font-size: 13px;
	font-weight: 500;
}

.shiko-otp-fallback {
	color: var(--shiko-text-muted, #6b6b6b);
	font-size: 12px;
	text-decoration: underline;
	text-underline-offset: 2px;
	margin-block-start: 8px;
}

.shiko-otp-success {
	padding: 12px 14px;
	background: rgba(138, 101, 0, 0.08);
	color: var(--shiko-success, #8A6500);
	border: 1px solid rgba(138, 101, 0, 0.2);
	border-radius: var(--shiko-radius, 8px);
	font-size: 13px;
	font-weight: 600;
	text-align: center;
}

.shiko-otp-switcher {
	max-inline-size: 480px;
	margin: 0 auto;
}

.shiko-otp-tabs {
	display: flex;
	gap: 0;
	margin-block-end: 16px;
	border-block-end: 1px solid var(--shiko-border, #e5e5e2);
}

.shiko-otp-tab {
	flex: 1;
	background: transparent;
	border: none;
	border-block-end: 2px solid transparent;
	padding-block: 12px;
	padding-inline: 16px;
	font-size: 13px;
	font-weight: 600;
	color: var(--shiko-text-secondary, #555);
	cursor: pointer;
	font-family: inherit;
	margin-block-end: -1px;
}

.shiko-otp-tab.is-active {
	color: var(--shiko-accent, #E40303);
	border-block-end-color: var(--shiko-accent, #E40303);
}

.shiko-otp-tab:hover:not(.is-active) {
	color: var(--shiko-text, #111);
}

.shiko-otp-panel .shiko-otp-form {
	border: none;
	padding-block: 0;
	padding-inline: 0;
}

@media (max-width: 480px) {
	.shiko-otp-form {
		padding: 16px;
	}
	.shiko-otp-title {
		font-size: 1.125rem;
	}
	.shiko-otp-otp-input {
		font-size: 18px;
		letter-spacing: 0.3em;
	}
}

/* Dark mode (matches shiko-theme [data-theme="dark"] convention) */
[data-theme="dark"] .shiko-otp-form,
[data-theme="dark"] .shiko-otp-panel .shiko-otp-form {
	background: var(--shiko-bg-secondary, #1a1a1a);
	border-color: var(--shiko-border, #333);
}

[data-theme="dark"] .shiko-otp-input {
	background: var(--shiko-input-bg, #222);
	border-color: var(--shiko-border, #333);
	color: var(--shiko-text, #eee);
}
