/* Kavenegar OTP Login — Animated OTP Verification V2 style */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
	--kol-bg: #0b0e1a;
	--kol-card: rgba(255, 255, 255, 0.06);
	--kol-border: rgba(255, 255, 255, 0.12);
	--kol-text: #f1f3f9;
	--kol-muted: #9aa3b8;
	--kol-accent: #6c5ce7;
	--kol-accent-2: #00cec9;
	--kol-error: #ff6b81;
	--kol-success: #2ecc71;
	--kol-radius: 20px;
}

html, body { height: 100%; }

body {
	font-family: Vazirmatn, 'IRANSans', 'Yekan Bakh', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
	background: var(--kol-bg);
	color: var(--kol-text);
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 16px;
	overflow-x: hidden;
}

/* پس‌زمینه متحرک */
.kol-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.kol-orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(90px);
	opacity: 0.45;
	animation: kol-float 14s ease-in-out infinite alternate;
}
.kol-orb-1 { width: 420px; height: 420px; background: #6c5ce7; top: -120px; right: -80px; }
.kol-orb-2 { width: 360px; height: 360px; background: #00cec9; bottom: -100px; left: -60px; animation-delay: -5s; }
.kol-orb-3 { width: 260px; height: 260px; background: #e84393; top: 45%; left: 55%; animation-delay: -9s; opacity: 0.3; }

@keyframes kol-float {
	from { transform: translate(0, 0) scale(1); }
	to   { transform: translate(-40px, 40px) scale(1.15); }
}

/* کارت */
.kol-card {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 400px;
	background: var(--kol-card);
	border: 1px solid var(--kol-border);
	border-radius: var(--kol-radius);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	padding: 36px 28px 28px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
	animation: kol-card-in 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes kol-card-in {
	from { opacity: 0; transform: translateY(24px) scale(0.97); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.kol-logo { text-align: center; margin-bottom: 24px; }
.kol-logo-icon {
	width: 60px; height: 60px;
	margin: 0 auto 12px;
	display: flex; align-items: center; justify-content: center;
	border-radius: 18px;
	background: linear-gradient(135deg, var(--kol-accent), var(--kol-accent-2));
	box-shadow: 0 10px 26px rgba(108, 92, 231, 0.45);
	animation: kol-pulse 2.6s ease-in-out infinite;
}
.kol-logo-icon svg { width: 30px; height: 30px; color: #fff; }
.kol-logo h1 { font-size: 17px; font-weight: 600; color: var(--kol-muted); }

@keyframes kol-pulse {
	0%, 100% { transform: scale(1); box-shadow: 0 10px 26px rgba(108, 92, 231, 0.45); }
	50%      { transform: scale(1.05); box-shadow: 0 14px 34px rgba(0, 206, 201, 0.4); }
}

/* مراحل */
.kol-step { display: none; }
.kol-step.is-active { display: block; animation: kol-step-in 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.kol-step.is-leaving { animation: kol-step-out 0.25s ease forwards; }

@keyframes kol-step-in {
	from { opacity: 0; transform: translateX(-28px); }
	to   { opacity: 1; transform: translateX(0); }
}
@keyframes kol-step-out {
	from { opacity: 1; transform: translateX(0); }
	to   { opacity: 0; transform: translateX(28px); }
}

.kol-step h2 { font-size: 21px; font-weight: 700; margin-bottom: 6px; text-align: center; }
.kol-sub { font-size: 13.5px; color: var(--kol-muted); text-align: center; margin-bottom: 22px; line-height: 1.9; }
.kol-sub b { color: var(--kol-text); font-weight: 600; direction: ltr; unicode-bidi: embed; }

/* فیلدها */
.kol-field { margin-bottom: 14px; }
.kol-row { display: flex; gap: 10px; }
.kol-row .kol-field { flex: 1; }

.kol-field input {
	width: 100%;
	padding: 14px 16px;
	font-size: 16px;
	font-family: inherit;
	color: var(--kol-text);
	background: rgba(255, 255, 255, 0.06);
	border: 1.5px solid var(--kol-border);
	border-radius: 14px;
	outline: none;
	transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.kol-field input::placeholder { color: #5b6478; }
.kol-field input:focus {
	border-color: var(--kol-accent);
	background: rgba(108, 92, 231, 0.08);
	box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.18);
}
.kol-field[dir="ltr"] input { text-align: left; letter-spacing: 0.5px; }

/* Honeypot */
#kolHp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* باکس‌های OTP */
.kol-otp-boxes { display: flex; gap: 10px; justify-content: center; margin-bottom: 16px; }
.kol-otp-input {
	width: 52px; height: 60px;
	font-size: 26px; font-weight: 700;
	font-family: inherit;
	text-align: center;
	color: var(--kol-text);
	background: rgba(255, 255, 255, 0.06);
	border: 1.5px solid var(--kol-border);
	border-radius: 14px;
	outline: none;
	caret-color: var(--kol-accent-2);
	transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.kol-otp-input:focus {
	border-color: var(--kol-accent);
	box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.2);
	transform: translateY(-3px);
}
.kol-otp-input.is-filled {
	border-color: var(--kol-accent-2);
	background: rgba(0, 206, 201, 0.1);
	animation: kol-pop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes kol-pop {
	0% { transform: scale(0.85); }
	60% { transform: scale(1.1); }
	100% { transform: scale(1); }
}

/* شیک خطا */
.kol-shake { animation: kol-shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes kol-shake {
	10%, 90% { transform: translateX(-2px); }
	20%, 80% { transform: translateX(4px); }
	30%, 50%, 70% { transform: translateX(-7px); }
	40%, 60% { transform: translateX(7px); }
}
.kol-otp-boxes.is-error .kol-otp-input { border-color: var(--kol-error); }

/* دکمه */
.kol-btn {
	position: relative;
	width: 100%;
	padding: 15px;
	font-size: 15.5px;
	font-weight: 700;
	font-family: inherit;
	color: #fff;
	background: linear-gradient(135deg, var(--kol-accent), var(--kol-accent-2));
	background-size: 160% 160%;
	border: none;
	border-radius: 14px;
	cursor: pointer;
	transition: transform 0.15s, box-shadow 0.25s, background-position 0.4s;
	overflow: hidden;
}
.kol-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(108, 92, 231, 0.4); background-position: 100% 0; }
.kol-btn:active { transform: translateY(0); }
.kol-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.kol-spinner {
	display: none;
	width: 18px; height: 18px;
	border: 2.5px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: kol-spin 0.7s linear infinite;
	vertical-align: middle;
	margin-inline-start: 8px;
}
.kol-btn.is-loading .kol-spinner { display: inline-block; }
.kol-btn.is-loading .kol-btn-label { opacity: 0.75; }
@keyframes kol-spin { to { transform: rotate(360deg); } }

/* لینک‌ها */
.kol-link {
	display: block;
	width: 100%;
	margin-top: 16px;
	background: none;
	border: none;
	color: var(--kol-muted);
	font-size: 13px;
	font-family: inherit;
	cursor: pointer;
	text-align: center;
	transition: color 0.2s;
}
.kol-link:hover:not(:disabled) { color: var(--kol-accent-2); }
.kol-link:disabled { cursor: default; opacity: 0.6; }
.kol-link.kol-inline { display: inline; width: auto; margin: 0; color: var(--kol-accent-2); }

/* خطا */
.kol-error {
	display: none;
	font-size: 13px;
	color: var(--kol-error);
	text-align: center;
	margin-bottom: 12px;
	animation: kol-step-in 0.3s;
}
.kol-error.is-visible { display: block; }

/* موفقیت */
.kol-success-step { text-align: center; }
.kol-success-mark { width: 90px; height: 90px; margin: 8px auto 20px; }
.kol-success-mark svg { width: 100%; height: 100%; }
.kol-check-circle {
	stroke: var(--kol-success);
	stroke-width: 2.5;
	stroke-dasharray: 166;
	stroke-dashoffset: 166;
	animation: kol-draw 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.kol-check-path {
	stroke: var(--kol-success);
	stroke-width: 3.5;
	stroke-linecap: round;
	stroke-dasharray: 48;
	stroke-dashoffset: 48;
	animation: kol-draw 0.4s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}
@keyframes kol-draw { to { stroke-dashoffset: 0; } }

/* موبایل */
@media (max-width: 420px) {
	.kol-card { padding: 28px 18px 20px; }
	.kol-otp-input { width: 46px; height: 54px; font-size: 22px; }
	.kol-otp-boxes { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
