/* ================= Authentication & Modals Styles ================= */
#toast-container { position: fixed; top: max(24px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 12px; pointer-events: none; width: 90%; max-width: 400px; }
.toast { background: var(--surface-color); color: var(--text-main); padding: 14px 20px; border-radius: 16px; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: 0.95rem; animation: toastSlideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; border-right: 4px solid; }
.toast.success { border-right-color: #10b981; }
.toast.error { border-right-color: #ef4444; }
@keyframes toastSlideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastFadeOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } }

#modal-wrapper { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 1000; }
#overlay-click { position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; z-index: 1; cursor: pointer; }

.auth-panel { position: relative; display: flex; flex-direction: column; z-index: 2; margin: auto; }
.drag-handle { display: none; width: 40px; height: 5px; background: var(--border-color); border-radius: 5px; margin: 0 auto 24px auto; }
.close-btn { position: absolute; top: 24px; right: 24px; background: var(--btn-bg); border: 1px solid var(--border-color); color: var(--text-muted); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; }
.close-btn:active { transform: scale(0.9); }

.logo-container { display: flex; justify-content: center; margin-bottom: 24px; }
.circular-logo { width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); }
.circular-logo img { width: 100%; height: 100%; object-fit: cover; }

.auth-panel h2 { text-align: center; margin-bottom: 8px; font-weight: 700; font-size: 1.5rem; }
.auth-panel .subtitle { text-align: center; color: var(--text-muted); margin-bottom: 32px; font-size: 0.95rem; }

.input-group { margin-bottom: 20px; text-align: right; }
.input-group label { display: block; margin-bottom: 10px; font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }
.input-group input { width: 100%; padding: 16px; background: var(--bg-color); border: 1.5px solid var(--border-color); border-radius: 16px; color: var(--text-main); font-size: 1rem; outline: none; transition: all 0.2s ease; }
.input-group input[type="tel"] { direction: ltr; text-align: left; font-family: 'Dana', system-ui, sans-serif; letter-spacing: 2px; font-size: 1.1rem; }
.input-group input:focus { border-color: #1a73e8; background: var(--surface-color); }

.btn-primary-full { width: 100%; padding: 16px; height: 56px; border: none; border-radius: 16px; background: #1a73e8; color: #ffffff; font-size: 1.05rem; font-weight: 700; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: all 0.2s; }
.btn-primary-full:active { transform: scale(0.97); }

.otp-wrapper { display: flex; flex-direction: column; align-items: center; }
.otp-inputs { display: flex; gap: 12px; justify-content: center; margin-bottom: 32px; direction: ltr; width: 100%; }
.otp-inputs input { flex: 1; max-width: 64px; height: 64px; text-align: center; font-size: 1.75rem; font-weight: 700; background: var(--bg-color); border: 1.5px solid var(--border-color); border-radius: 16px; color: var(--text-main); outline: none; transition: all 0.2s ease; }
.otp-inputs input:focus { border-color: #1a73e8; background: var(--surface-color); transform: translateY(-2px); }

.timer-container { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; }
.timer-wrapper { position: relative; width: 68px; height: 68px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.timer-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-bg { fill: none; stroke: var(--border-color); stroke-width: 3; }
.timer-progress { fill: none; stroke: #1a73e8; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 132; transition: stroke-dashoffset 1s linear, stroke 0.3s ease; }
#time-display { font-weight: 700; font-size: 0.95rem; direction: ltr; margin-top: 2px; }

#resend-btn { font-weight: 700; font-size: 0.95rem; padding: 8px 16px; border-radius: 8px; color: #1a73e8; background: transparent; border: none; cursor: pointer; transition: 0.2s;}
#resend-btn:disabled { color: var(--text-muted); cursor: not-allowed; }

.info-alert { display: flex; align-items: flex-start; gap: 12px; background-color: rgba(26, 115, 232, 0.08); border: 1px solid rgba(26, 115, 232, 0.2); color: #1a73e8; padding: 14px 16px; border-radius: 16px; font-size: 0.85rem; font-weight: 500; margin-bottom: 24px; line-height: 1.6; text-align: right; }
[data-theme="dark"] .info-alert { background-color: rgba(138, 180, 248, 0.1); border-color: rgba(138, 180, 248, 0.2); color: #8ab4f8; }
.info-alert-icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px; }

.step { display: none; width: 100%; }
.step.active { display: block; animation: slideIn 0.3s cubic-bezier(0.25, 1, 0.5, 1); }

@media (min-width: 601px) {
    #modal-wrapper .auth-panel { animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
}
@media (max-width: 600px) {
    #modal-wrapper { align-items: flex-end; }
    #modal-wrapper .auth-panel { padding: 32px 24px max(32px, env(safe-area-inset-bottom)); border: none; border-radius: 32px 32px 0 0; animation: slideUpBottom 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
    .drag-handle { display: block; }
    .close-btn { top: 16px; right: 16px; }
}

@keyframes slideUpBottom { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }



.mobile-display-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.mobile-display-wrapper .subtitle {
    margin-bottom: 0;
}

#display-user-mobile {
    color: var(--text-main);
    letter-spacing: 1px;
    font-weight: 700;
}

.change-mobile-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #1a73e8;
    background: rgba(26, 115, 232, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-family: inherit;
}

.change-mobile-btn:hover {
    background: rgba(26, 115, 232, 0.18);
    transform: translateY(-1px);
}

.change-mobile-btn:active {
    transform: translateY(1px);
}

.change-mobile-btn svg {
    width: 14px;
    height: 14px;
}

/* حالت دارک مود برای دکمه */
[data-theme="dark"] .change-mobile-btn {
    background: rgba(138, 180, 248, 0.15);
    color: #8ab4f8;
}
[data-theme="dark"] .change-mobile-btn:hover {
    background: rgba(138, 180, 248, 0.25);
}


/* ================= Limit Reached Modal Styles ================= */
#limit-modal-wrapper { position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; z-index: 1001; opacity: 0; transition: opacity 0.3s ease; }
#limit-modal-wrapper.show { opacity: 1; }

.limit-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.limit-panel { position: relative; background: var(--surface-color); padding: 32px 24px; border-radius: 24px; text-align: center; max-width: 360px; width: 90%; box-shadow: var(--shadow-md); transform: scale(0.9) translateY(20px); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 2; }
#limit-modal-wrapper.show .limit-panel { transform: scale(1) translateY(0); }

.limit-icon-container { width: 64px; height: 64px; background: rgba(26, 115, 232, 0.1); color: #1a73e8; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px auto; }
[data-theme="dark"] .limit-icon-container { background: rgba(138, 180, 248, 0.15); color: #8ab4f8; }

.limit-panel h2 { margin: 0 0 12px 0; font-size: 1.4rem; color: var(--text-main); font-weight: 800; }
.limit-panel p { margin: 0 0 24px 0; color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }

.limit-btn-primary { width: 100%; padding: 14px; background: #1a73e8; color: #fff; border: none; border-radius: 16px; font-size: 1.05rem; font-weight: 700; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3); font-family: inherit; }
.limit-btn-primary:active { transform: scale(0.96); }

.limit-btn-secondary { width: 100%; padding: 12px; background: transparent; color: var(--text-muted); border: none; font-size: 0.95rem; font-weight: 600; margin-top: 8px; cursor: pointer; border-radius: 12px; transition: 0.2s; font-family: inherit; }
.limit-btn-secondary:hover { background: rgba(0,0,0,0.05); }
[data-theme="dark"] .limit-btn-secondary:hover { background: rgba(255,255,255,0.05); }