/* پنل کاربری - صفحه ورود (همان استایل ادمین: #667eea, #764ba2) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Shabnam", Tahoma, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow-x: hidden;
}

.login-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.login-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.overlay {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 2;
}

.content-wrapper {
    text-align: center;
    max-width: 600px;
    padding: 2rem;
}

.brand-section {
    margin-bottom: 4rem;
}

.brand-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
    animation: float 3s ease-in-out infinite;
}

.brand-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.brand-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.features-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    opacity: 0.9;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateX(-10px);
}

.feature-item i {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.login-form-section {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-section {
    margin-bottom: 1rem;
}

.logo-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.login-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.welcome-text {
    color: #666;
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* راهنمای ورود — چند خط، بدون برش متن */
.ta-ul-login-welcome-hint {
    font-size: 0.92rem;
    line-height: 1.65;
    margin-bottom: 0.85rem;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
    text-wrap: pretty;
}

.ta-ul-login-remember-block {
    margin-bottom: 1.25rem !important;
}

.ta-ul-login-remember-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.65rem;
}

.ta-ul-login-badge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    align-items: stretch;
}

.ta-ul-login-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.32rem 0.4rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.05);
    color: #5a62c4;
    text-decoration: none;
    line-height: 1.35;
    min-height: 2.1rem;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ta-ul-login-badge:hover {
    background: rgba(102, 126, 234, 0.11);
    border-color: rgba(102, 126, 234, 0.32);
    color: #4a52b0;
    text-decoration: none;
}

.back-to-home {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.back-to-home:hover {
    color: #764ba2;
    background: rgba(102, 126, 234, 0.15);
    transform: translateX(5px);
    text-decoration: none;
}

.login-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.input-group {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.input-group:focus-within {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.input-group.login-mobile-invalid {
    box-shadow: 0 0 0 2px #dc3545;
}
.input-group.login-mobile-invalid:focus-within {
    box-shadow: 0 0 0 2px #dc3545;
}

.input-group-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 0.75rem 1rem;
}

.login-form-section .form-control {
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.login-form-section .form-control:focus {
    background: white;
    box-shadow: none;
    outline: none;
}

.login-form-section .form-control::placeholder {
    color: #999;
}

#togglePassword {
    border: none;
    background: #f8f9fa;
    color: #666;
    transition: all 0.3s ease;
}

#togglePassword:hover {
    background: #e9ecef;
    color: #333;
}

.login-form-section .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

/* Legacy: لینک فراموشی بدون badge — صفحات دیگر */
.forgot-password:not(.ta-ul-login-badge) {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password:not(.ta-ul-login-badge):hover {
    color: #764ba2;
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    transition: all 0.3s ease;
    margin-top: 1rem;
    color: white;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.8;
    cursor: wait;
}

.login-footer {
    text-align: center;
}

.help-section {
    margin-top: 1.5rem;
}

.help-section p {
    color: #666;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.help-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.help-link:hover {
    color: #764ba2;
}

/* مودال «ارتباط با ما» — ورود پنل */
.login-contact-modal .modal-dialog {
    max-width: 420px;
}

.login-contact-modal__content {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.login-contact-modal__hero {
    position: relative;
    padding: 1.75rem 1.5rem 1.35rem;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-contact-modal__close {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    opacity: 0.85;
}

.login-contact-modal__hero-icon {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 0.75rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    font-size: 1.35rem;
}

.login-contact-modal__title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.login-contact-modal__subtitle {
    font-size: 0.86rem;
    opacity: 0.92;
    line-height: 1.55;
}

.login-contact-modal__body {
    padding: 1.15rem 1.15rem 1.35rem;
    background: #f8fafc;
}

.login-contact-modal__channels {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.login-contact-modal__channel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.login-contact-modal__channel:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
    color: inherit;
}

.login-contact-modal__channel--phone:hover { border-color: rgba(13, 110, 253, 0.35); }
.login-contact-modal__channel--whatsapp:hover { border-color: rgba(37, 211, 102, 0.4); }
.login-contact-modal__channel--bale:hover { border-color: rgba(0, 132, 255, 0.4); }

.login-contact-modal__channel-icon {
    flex-shrink: 0;
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
}

.login-contact-modal__channel--phone .login-contact-modal__channel-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.login-contact-modal__channel--whatsapp .login-contact-modal__channel-icon { background: linear-gradient(135deg, #25d366, #128c7e); }
.login-contact-modal__channel--bale .login-contact-modal__channel-icon { background: linear-gradient(135deg, #0084ff, #0066cc); }

.login-contact-modal__channel-icon--bale img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.login-contact-modal__channel-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    text-align: right;
}

.login-contact-modal__channel-label {
    font-weight: 700;
    font-size: 0.92rem;
    color: #0f172a;
}

.login-contact-modal__channel-value {
    font-size: 0.88rem;
    color: #475569;
    font-variant-numeric: tabular-nums;
}

.login-contact-modal__channel-desc {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
}

.login-contact-modal__channel-go {
    flex-shrink: 0;
    color: #94a3b8;
    font-size: 0.85rem;
}

.login-contact-modal__empty {
    padding: 0.5rem 0;
}

/* Toast: همیشه سمت راست (کنار فرم سفید)، آیکون بزرگ‌تر */
.login-toast-container {
    right: 1rem;
    left: auto;
}

.toast {
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
    border: none;
    overflow: hidden;
}

.toast-body {
    padding: 1rem 1.25rem;
    color: #fff;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.toast .toast-icon {
    opacity: 0.95;
    font-size: 1.35rem;
    width: 1.5rem;
    text-align: center;
}

.toast .btn-close {
    filter: invert(1);
    opacity: 0.85;
}

.toast .btn-close:hover {
    opacity: 1;
}

.toast--success .toast-body {
    background: linear-gradient(135deg, #0f766e 0%, #059669 50%, #10b981 100%);
}

.toast--error .toast-body {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #ef4444 100%);
}

.toast--warning .toast-body {
    background: linear-gradient(135deg, #c2410c 0%, #ea580c 50%, #f97316 100%);
    color: #fff;
}

.toast--info .toast-body {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #3b82f6 100%);
}

.validation-summary {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: #f8d7da;
    color: #721c24;
    font-size: 0.9rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@media (max-width: 991.98px) {
    .login-form-section {
        min-height: 100vh;
        padding: 1rem;
        box-shadow: none;
    }
    .login-container { max-width: 100%; }
    .brand-title { font-size: 2.5rem; }
    .content-wrapper { padding: 1rem; }
}

@media (max-width: 575.98px) {
    .login-form-section { padding: 1rem; }
    .brand-title { font-size: 2rem; }
    .brand-subtitle { font-size: 1rem; }
    .feature-item { font-size: 1rem; }
}

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.login-form-section .form-control:focus,
.login-form-section .btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #667eea; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #764ba2; }

/* iOS Safari zoom önleme — standalone login (Layout=null, layout.css yok) */
@media (max-width: 767.98px) {
    body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="file"]):not([type="image"]):not([type="range"]):not([type="color"]),
    body select,
    body textarea {
        font-size: 16px !important;
    }
}
