/* استایل فرم OTP - نسخه نهایی */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.otp-form-container {
    max-width: 480px;
    margin: 40px auto;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    font-family: 'Segoe UI', Tahoma, sans-serif;
    direction: rtl;
}

/* هدر بنفش */
.otp-header {
    background: linear-gradient(135deg, #8a2be2 0%, #6a1bc2 100%);
    padding: 30px 25px;
    text-align: center;
    color: white;
}

.otp-header h2 {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 700;
}

.otp-header .subtitle {
    font-size: 15px;
    opacity: 0.9;
    font-weight: 300;
}

/* بدنه فرم */
.otp-body {
    padding: 30px 35px;
}

/* پیام‌ها */
.otp-message {
    padding: 14px 18px;
    margin-bottom: 25px;
    border-radius: 8px;
    font-size: 15px;
    text-align: center;
    font-weight: 500;
}

.otp-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.otp-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.otp-info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* فیلد شماره موبایل - کلاس جدید */
.phone-input {
    width: 100%;
    padding: 18px 22px;
    margin: 18px 0;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 20px;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    text-align: center;
    direction: ltr;
    letter-spacing: 1.5px;
    background: #f8fafc;
    font-weight: 500;
    transition: all 0.25s ease;
    height: 62px;
    color: #1e293b;
    display: block;
}

.phone-input::placeholder {
    color: #94a3b8;
    font-size: 17px;
    text-align: center;
    direction: rtl;
    letter-spacing: normal;
    font-weight: 400;
}

/* فیلد کد OTP - کلاس جدید */
.otp-code-input {
    width: 100%;
    padding: 18px;
    margin: 18px 0;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 28px;
    text-align: center;
    letter-spacing: 8px;
    font-weight: 700;
    font-family: 'Courier New', monospace, sans-serif;
    background: #f8fafc;
    direction: ltr;
    height: 68px;
    color: #1e293b;
    display: block;
}

.otp-code-input::placeholder {
    font-size: 17px;
    letter-spacing: normal;
    color: #94a3b8;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    text-align: center;
    direction: rtl;
    font-weight: 400;
}

/* استایل focus */
.phone-input:focus,
.otp-code-input:focus {
    outline: none;
    border-color: #8a2be2;
    box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.2);
    background: white;
    transform: translateY(-1px);
}

/* دکمه‌ها */
.otp-button {
    width: 100%;
    padding: 16px 20px;
    margin: 12px 0;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    transition: all 0.25s ease;
    height: 56px;
    display: block;
}

.primary-button {
    background: linear-gradient(135deg, #8a2be2 0%, #7a1bd2 100%);
    color: white;
}

.primary-button:hover {
    background: linear-gradient(135deg, #7a1bd2 0%, #6a0bc2 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(138, 43, 226, 0.3);
}

.verify-button {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
}

.verify-button:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(40, 167, 69, 0.3);
}

.secondary-button {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.secondary-button:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(108, 117, 125, 0.3);
}

.otp-button:disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* بخش تأیید کد */
#register-verify-section,
#login-verify-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px dashed #e2e8f0;
}

.mobile-display {
    text-align: center;
    margin: 20px 0;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    font-weight: 600;
    color: #334155;
    font-size: 17px;
    border: 1px solid #e2e8f0;
}

.mobile-display span {
    color: #8a2be2;
    font-weight: 700;
    font-size: 18px;
}

/* شمارش معکوس */
.countdown-timer {
    text-align: center;
    margin: 18px 0;
    color: #64748b;
    font-size: 15px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

/* فوتر */
.form-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 15px;
}

.form-footer a {
    color: #8a2be2;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.25s;
}

.form-footer a:hover {
    text-decoration: underline;
    background: rgba(138, 43, 226, 0.1);
}

/* ریسپانسیو */
@media (max-width: 520px) {
    .otp-form-container {
        max-width: 95%;
        margin: 25px auto;
        border-radius: 10px;
    }
    
    .otp-body {
        padding: 25px;
    }
    
    .otp-header {
        padding: 25px 20px;
    }
    
    .otp-header h2 {
        font-size: 22px;
    }
    
    .otp-header .subtitle {
        font-size: 14px;
    }
    
    /* فیلد شماره موبایل در موبایل */
    .phone-input {
        font-size: 18px;
        padding: 16px 20px;
        height: 58px;
    }
    
    .phone-input::placeholder {
        font-size: 16px;
    }
    
    /* فیلد کد OTP در موبایل */
    .otp-code-input {
        font-size: 24px;
        letter-spacing: 6px;
        padding: 16px;
        height: 62px;
    }
    
    .otp-code-input::placeholder {
        font-size: 16px;
    }
    
    /* دکمه‌ها در موبایل */
    .otp-button {
        padding: 15px 18px;
        font-size: 16px;
        height: 54px;
    }
    
    .mobile-display {
        font-size: 16px;
        padding: 14px;
    }
    
    .mobile-display span {
        font-size: 17px;
    }
}

/* انیمیشن‌های ظریف */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#register-verify-section,
#login-verify-section {
    animation: fadeInUp 0.4s ease-out;
}

/* استایل برای حالت‌های مختلف */
.phone-input.success {
    border-color: #28a745;
    background: #f0fdf4;
}

.phone-input.error {
    border-color: #dc2626;
    background: #fef2f2;
}

.otp-code-input.success {
    border-color: #28a745;
    background: #f0fdf4;
}

.otp-code-input.error {
    border-color: #dc2626;
    background: #fef2f2;
}

/* استایل‌های خاص برای جلوگیری از override شدن */
.otp-form input[type="tel"] {
    font-size: 20px !important;
    padding: 18px 22px !important;
    height: 62px !important;
}

#register-otp-code, #login-otp-code {
    font-size: 28px !important;
    letter-spacing: 8px !important;
    padding: 18px !important;
    height: 68px !important;
}