/* استایل اصلی افزونه */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/*جعبه ثبت نام */
.pap-register-box {
    width: 100%;
    max-width: 1000px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 60px;
    margin: 0 auto;
}

/* جعبه اصلی فرم تماس و  کد تایید  */
.pap-auth-box {
    width: 100%;
    max-width: 450px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 60px;
    margin: 0 auto;
}
.pap-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.pap-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.pap-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    animation: papModalSlideIn 0.3s ease-out;
}

@keyframes papModalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.pap-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pap-modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 600;
}

.pap-close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.pap-close-modal:hover {
    background: #f3f4f6;
    color: #374151;
}

.pap-modal-body {
    padding: 24px;
}

.pap-step {
    display: none;
}

.pap-step.active {
    display: block;
    animation: papFadeIn 0.5s ease-out;
}

@keyframes papFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pap-step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.pap-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s;
}

.pap-step-number.active {
    background: #3b82f6;
    color: white;
    animation: papPulse 2s infinite;
}

@keyframes papPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
}

.pap-step-header h4 {
    margin: 0;
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 600;
}

.pap-step-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.pap-step-info p {
    margin: 0 0 8px 0;
    color: #0369a1;
    font-size: 0.875rem;
    line-height: 1.5;
}

.pap-step-info p:last-child {
    margin-bottom: 0;
}

.pap-timer-text {
    font-weight: 600;
    color: #dc2626 !important;
}

.pap-form {
    animation: papFormSlideIn 0.4s ease-out;
}

@keyframes papFormSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.pap-form-group {
    margin-bottom: 20px;
}

.pap-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.pap-form-group-half {
    flex: 1;
}

.pap-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
}

.pap-input-with-icon {
    position: relative;
}

.pap-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.25rem;
}

.pap-input-with-icon input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
}

.pap-input-with-icon input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pap-input-with-icon input:invalid {
    border-color: #ef4444;
}

.pap-input-hint {
    margin-top: 6px;
    color: #6b7280;
    font-size: 0.75rem;
}

.pap-code-inputs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 24px 0;
    direction: ltr !important;
}


.pap-code-input {
    width: 52px;
    height: 56px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid #dcdcdc;
    transition: 0.2s ease;
}

.pap-code-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
    outline: none;
}

.pap-toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
}

.pap-checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pap-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #d1d5db;
    cursor: pointer;
}

.pap-checkbox-group label {
    margin: 0;
    font-size: 0.875rem;
    color: #4b5563;
}

.pap-checkbox-group a {
    color: #3b82f6;
    text-decoration: none;
}

.pap-checkbox-group a:hover {
    text-decoration: underline;
}

.pap-form-actions {
    margin-top: 32px;
}

.pap-btn {
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.pap-btn-block {
    width: 100%;
    margin-bottom: 12px;
}

.pap-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.pap-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
}

.pap-btn-primary:active {
    transform: translateY(0);
}

.pap-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.pap-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
}

.pap-btn-link {
    background: transparent;
    color: #6b7280;
    text-decoration: underline;
}

.pap-btn-link:hover {
    color: #374151;
    background: #f9fafb;
}

.pap-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.pap-btn-loader {
    display: none;
}

.pap-spinner-small {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: papSpin 1s linear infinite;
}

@keyframes papSpin {
    to {
        transform: rotate(360deg);
    }
}

.pap-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.pap-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #6b7280;
    font-size: 0.875rem;
}

.pap-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: papSpin 1s linear infinite;
}

.pap-form-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.pap-terms-text {
    margin: 0;
    color: #6b7280;
    font-size: 0.75rem;
    text-align: center;
    line-height: 1.5;
}

.pap-terms-text a {
    color: #3b82f6;
    text-decoration: none;
}

.pap-terms-text a:hover {
    text-decoration: underline;
}

/* استایل‌های ریسپانسیو */
@media (max-width: 768px) {
    .pap-modal-content {
        width: 95%;
        max-width: 400px;
        border-radius: 16px;
    }
    
    .pap-form-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .pap-code-input {
        width: 50px !important;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .pap-modal-header {
        padding: 20px 20px 12px;
    }
    
    .pap-modal-body {
        padding: 20px;
    }
    
    .pap-modal-footer {
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .pap-auth-box {
        padding: 20px;
        border-radius: 12px;
    }
    
    .pap-code-input {
        width: 44px;
        height: 48px;
        font-size: 18px;
    }
    
    .pap-step-header h4 {
        font-size: 1rem;
    }
    
    .pap-btn {
        padding: 12px 20px;
        font-size: 0.875rem;
    }
}

/* استایل برای حالت لاگین شده */
.pap-logged-in-user {
    max-width: 400px;
    margin: 0 auto;
}

.pap-user-info {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.pap-user-avatar {
    margin-bottom: 20px;
}

.pap-user-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.pap-user-details h3 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 600;
}

.pap-user-details p {
    margin: 0 0 24px 0;
    color: #6b7280;
    font-size: 1rem;
}

.pap-logout-btn {
    display: inline-block;
    padding: 12px 32px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.pap-logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.4);
}

/* انیمیشن‌های اضافی */
.pap-form-step {
    position: relative;
    padding-top: 20px; /* این مقدار را به دلخواه خود بیشتر کنید (مثلا 40px) */
    overflow: hidden;
}


.pap-form-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
    transform: translateX(-100%);
    animation: papProgress 0.5s ease-out forwards;
}

@keyframes papProgress {
    to {
        transform: translateX(0);
    }
}

/* استایل برای پیام‌های خطا و موفقیت */
.pap-message {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    animation: papMessageSlideIn 0.3s ease-out;
}

@keyframes papMessageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pap-message-success {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.pap-message-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.pap-message-warning {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
}

/* استایل برای دکمه‌های حالت‌های مختلف */
.pap-btn-loading .pap-btn-text {
    opacity: 0;
}

.pap-btn-loading .pap-btn-loader {
    display: block;
}

/* استایل برای فیلدهای معتبر/نامعتبر */
.pap-input-valid {
    border-color: #10b981 !important;
    background-color: #f0fdf4 !important;
}

.pap-input-invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

/* استایل برای تایمر */
#pap-timer {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #dc2626;
    animation: papBlink 1s infinite;
}

@keyframes papBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* استایل برای صفحه‌بندی مراحل */
.pap-step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.pap-step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: all 0.3s;
}

.pap-step-dot.active {
    background: #3b82f6;
    transform: scale(1.2);
}

/* استایل برای حالت تاریک (اگر نیاز بود) */
@media (prefers-color-scheme: dark) {
    .pap-modal-content {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .pap-modal-header {
        border-bottom-color: #374151;
    }
    
    .pap-modal-header h3 {
        color: #f9fafb;
    }
    
    .pap-step-header h4 {
        color: #f9fafb;
    }
    
    .pap-step-info {
        background: #374151;
        border-color: #4b5563;
    }
    
    .pap-step-info p {
        color: #d1d5db;
    }
    
    .pap-form-group label {
        color: #d1d5db;
    }
    
    .pap-input-with-icon input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .pap-input-with-icon input:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }
    
    .pap-input-hint {
        color: #9ca3af;
    }
    
    .pap-code-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .pap-checkbox-group label {
        color: #d1d5db;
    }
    
    .pap-modal-footer {
        border-top-color: #374151;
    }
    
    .pap-terms-text {
        color: #9ca3af;
    }
    
    .pap-user-info {
        background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    }
    
    .pap-user-details h3 {
        color: #f9fafb;
    }
    
    .pap-user-details p {
        color: #d1d5db;
    }
}



/* ==========================================================================
   استایل‌های مربوط به تب‌های ورود (ورود با پیامک / رمز عبور)
   ========================================================================== */

.pap-login-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    background: #f3f4f6;
    padding: 6px;
    border-radius: 12px;
}

.pap-login-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 15px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-align: center;
}

.pap-login-tab-btn:hover {
    color: #374151;
}

.pap-login-tab-btn.active {
    background: #ffffff;
    color: #3b82f6;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.pap-login-tab-content {
    display: none;
    animation: papTabFadeIn 0.4s ease-out;
}

.pap-login-tab-content.active {
    display: block;
}

@keyframes papTabFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* اصلاح جهت نوشتار برای فیلد نام کاربری، ایمیل و شماره موبایل */
input#pap-login-username, input[type="email"], input[type="tel"] { 
    direction: ltr !important; 
    text-align: right !important; 
}


/* اگر می‌خواهید وقتی فیلد خالی است، نگهدارنده (Placeholder) راست‌چین بماند: */
input#pap-login-username::placeholder,
input[type="email"]::placeholder,
input[type="tel"]::placeholder {
    direction: rtl;
    text-align: right;
}
