@font-face {
    font-family: YekanBakh;
    src: url('../fonts/YekanBakhFaNum-VF.ttf') format('truetype');
    font-display: swap;
}

body.auth-page,
body.auth-page #login-app,
body.auth-page #login-app input,
body.auth-page #login-app button,
body.auth-page #login-app p,
body.auth-page #login-app span,
body.auth-page #login-app label,
body.auth-page #login-app a,
body.auth-page #login-app .login-errors,
body.auth-page #login-app .login-errors *,
body.auth-page #login-app .login-error-item {
    font-family: YekanBakh, Tahoma, 'Segoe UI', sans-serif !important;
    font-feature-settings: "ss02";
}

body.auth-page #login-app input::placeholder {
    font-family: YekanBakh, Tahoma, 'Segoe UI', sans-serif !important;
}

body.auth-page #login-app input[type='number'] {
    font-variant-numeric: tabular-nums;
}

/* Digikala-style OTP boxes */
.otp-autofill-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

.otp-boxes {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    direction: ltr;
}

.otp-box {
    width: 46px;
    height: 52px;
    border-radius: 12px;
    border: 1.5px solid #FA5C64;
    background: #fff;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #010416;
    outline: none;
    caret-color: #FA5C64;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.otp-box:focus {
    border-color: #FA5C64;
    box-shadow: 0 0 0 3px rgba(250, 92, 100, 0.18);
}

.otp-box.is-filled {
    border-color: #FA5C64;
    background: rgba(250, 92, 100, 0.04);
}

.otp-boxes.is-error .otp-box {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
    animation: otp-shake 0.4s ease;
}

.otp-boxes.is-success .otp-box {
    border-color: #23DB90;
    background: linear-gradient(160deg, #e8fff5 0%, #c9f8e2 100%);
    color: #0a7a4d;
    box-shadow: 0 0 0 3px rgba(35, 219, 144, 0.22);
    animation: otp-success-pop 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.otp-boxes.is-success .otp-box:nth-child(1) { animation-delay: 0ms; }
.otp-boxes.is-success .otp-box:nth-child(2) { animation-delay: 45ms; }
.otp-boxes.is-success .otp-box:nth-child(3) { animation-delay: 90ms; }
.otp-boxes.is-success .otp-box:nth-child(4) { animation-delay: 135ms; }
.otp-boxes.is-success .otp-box:nth-child(5) { animation-delay: 180ms; }
.otp-boxes.is-success .otp-box:nth-child(6) { animation-delay: 225ms; }

.otp-boxes.is-success::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 16px;
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(35, 219, 144, 0.22) 0%, transparent 68%);
    animation: otp-success-glow 0.7s ease-out both;
}

.otp-boxes {
    position: relative;
}

@keyframes otp-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}

@keyframes otp-success-pop {
    0% {
        transform: scale(1);
    }
    35% {
        transform: scale(1.08);
    }
    70% {
        transform: scale(0.98);
    }
    100% {
        transform: scale(1);
        box-shadow:
            0 0 0 3px rgba(35, 219, 144, 0.28),
            0 8px 20px rgba(35, 219, 144, 0.25);
    }
}

@keyframes otp-success-glow {
    0% { opacity: 0; transform: scale(0.9); }
    40% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.15); }
}

html.dark body.auth-page .otp-box {
    background: #1e293b;
    border-color: #FA5C64;
    color: #f1f5f9;
}

html.dark body.auth-page .otp-box:focus {
    border-color: #FB7185;
    box-shadow: 0 0 0 3px rgba(250, 92, 100, 0.22);
}

html.dark body.auth-page .otp-box.is-filled {
    background: rgba(250, 92, 100, 0.08);
    border-color: #FA5C64;
}

html.dark body.auth-page .otp-boxes.is-success .otp-box {
    background: linear-gradient(160deg, #12352a 0%, #0f2a22 100%);
    color: #5ee9b5;
}

@media (max-width: 380px) {
    .otp-box {
        width: 40px;
        height: 46px;
        font-size: 18px;
        border-radius: 10px;
    }

    .otp-boxes {
        gap: 6px;
    }
}
