/* ====================================
   سیستم ورود و ثبت‌نام
   طراحی UI/UX حرفه‌ای
==================================== */

/* 1. عناوین اصلی */
.auth-main-title {
    font-size: 38px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    text-align: center;
    margin-bottom: 15px !important;
    line-height: 1.4;
}

.auth-sub-title {
    font-size: 32px !important;
    font-weight: 700 !important;
    color: #ee8961 !important;
    text-align: center !important;
    margin-bottom: 20px !important;
    line-height: 1.4;
}

.auth-description {
    font-size: 17px !important;
    color: rgba(255, 255, 255, 0.95) !important;
    text-align: center !important;
    margin-bottom: 35px !important;
    line-height: 1.8;
}

/* 2. Auth Forms (فرم‌های ورود/ثبت‌نام) */
.auth-form {
    display: none;
    animation: fadeIn 0.4s ease;
}

.auth-form.active {
    display: block;
}

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

/* لیست فرم - فیلدها زیر هم */
.auth-form-list {
    max-width: 550px;
    margin: 0 auto;
    display: flex !important;
    flex-direction: column !important;
}

.auth-form-list li {
    margin-bottom: 20px;
    width: 100% !important;
    display: block !important;
    float: none !important;
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper input {
    padding-right: 50px !important;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.3s ease;
    z-index: 10;
}

.password-toggle:hover {
    color: #ee8961;
}

.password-toggle:focus {
    outline: none;
}

/* فیلدها همیشه عمودی - ترتیب طبیعی */

/* اطمینان از عمودی بودن فیلدها در همه حالات (دسکتاپ و موبایل) */
#chat-section .auth-form-list,
#chat-section .form-box ul,
#chat-section .auth-form ul {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
}

#chat-section .auth-form-list li,
#chat-section .form-box ul li,
#chat-section .auth-form ul li {
    width: 100% !important;
    display: block !important;
    float: none !important;
    clear: both !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* استایل فیلدهای input - توپُر با border-radius هماهنگ */
.auth-form-list input[type="text"],
.auth-form-list input[type="password"] {
    width: 100%;
    padding: 18px 25px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.auth-form-list input::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 400;
}

.auth-form-list input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: #ee8961 !important;
    box-shadow: 0 0 0 4px rgba(238, 137, 97, 0.15);
}

/* 3. Auth Buttons (دکمه‌های اصلی) */
.auth-btn {
    width: 100%;
    padding: 18px 25px;
    background: #ee8961;
    color: #ffffff;
    border: 2px solid #ee8961;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}

.auth-btn i {
    font-size: 18px;
}

.auth-btn:hover {
    background: #0a3978;
    border-color: #0a3978;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(10, 57, 120, 0.4);
}

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

/* 4. Forgot Password Link - ساده و بدون border */
.forgot-pass-wrapper {
    margin-bottom: 0 !important;
    margin-top: 10px !important;
}

.forgot-password-link {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    padding: 0;
    border: none;
    background: transparent;
}

.forgot-password-link:hover {
    color: #ee8961;
    text-decoration: underline;
}

.forgot-password-link svg {
    display: none;
}

/* 5. Token Modal Styles */
.token-modal-content {
    border-radius: 15px;
    border: none;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.token-modal-content .modal-header {
    background: linear-gradient(135deg, #0a3978 0%, #1565c0 100%);
    color: #ffffff;
    border: none;
    padding: 25px 30px;
}

.token-modal-content .modal-header .modal-title {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff !important;
}

.token-modal-content .modal-header .modal-title i {
    font-size: 28px;
    color: #4caf50;
}

.token-modal-content .modal-header button.close {
    color: #ffffff !important;
    opacity: 1;
    text-shadow: none;
    font-size: 32px;
    font-weight: 300;
}

.token-modal-content .modal-header button.close:hover {
    color: #ee8961 !important;
}

.token-modal-content .modal-body {
    padding: 30px;
}

.token-display-box {
    text-align: center;
}

.token-info {
    font-size: 16px;
    font-weight: 600;
    color: #0a3978;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.token-info i {
    font-size: 20px;
    color: #ee8961;
}

.token-value {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    color: #0a3978;
    word-break: break-all;
    border: 2px dashed #0a3978;
    position: relative;
    overflow: hidden;
}

.token-value::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(238, 137, 97, 0.1), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.copy-token-btn {
    background: #ee8961;
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.copy-token-btn:hover {
    background: #0a3978;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(10, 57, 120, 0.3);
}

.copy-token-btn i {
    font-size: 16px;
}

.token-instructions {
    margin-top: 30px;
    text-align: right;
    background: #fff3e0;
    padding: 20px;
    border-radius: 10px;
    border-right: 4px solid #ff9800;
}

.token-instructions p {
    color: #e65100;
    font-weight: 700;
    margin-bottom: 15px;
}

.token-instructions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.token-instructions ul li {
    color: #5d4037;
    margin-bottom: 10px;
    padding-right: 25px;
    position: relative;
    line-height: 1.6;
}

.token-instructions ul li:before {
    content: '✓';
    position: absolute;
    right: 0;
    color: #4caf50;
    font-weight: 700;
    font-size: 18px;
}

.modal-footer {
    justify-content: center !important;
    border-top: 1px solid #eee;
}

.token-modal-btn {
    background: #0a3978;
    color: #ffffff;
    border: none;
    padding: 12px 35px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.token-modal-btn:hover {
    background: #ee8961;
    transform: translateY(-2px);
}

/* 6. Token Input Form */
.token-input {
    padding: 15px;
    border: 2px solid #0a3978;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.token-input:focus {
    outline: none;
    border-color: #ee8961;
    box-shadow: 0 0 0 4px rgba(238, 137, 97, 0.1);
}

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

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #0a3978;
    text-align: right;
}

/* 7. Input Fields - بدون آیکون */
.form-box ul li input {
    padding-right: 20px !important;
    padding-left: 20px !important;
}

.form-box ul li i {
    display: none !important;
}

/* 8. Responsive Design */
@media only screen and (max-width: 991px) {
    .auth-main-title {
        font-size: 32px !important;
    }

    .auth-sub-title {
        font-size: 26px !important;
    }

    .auth-description {
        font-size: 16px !important;
    }

    .auth-btn {
        padding: 16px 22px;
        font-size: 16px;
    }
}

@media only screen and (max-width: 767px) {
    .contact-form {
        padding: 40px 30px !important;
    }

    .auth-main-title {
        font-size: 28px !important;
    }

    .auth-sub-title {
        font-size: 22px !important;
    }

    .auth-description {
        font-size: 15px !important;
    }

    .auth-form-list {
        max-width: 100%;
    }

    .auth-btn {
        padding: 15px 20px;
        font-size: 15px;
    }

    .auth-btn svg {
        width: 18px;
        height: 18px;
    }

    .token-modal-content .modal-header .modal-title {
        font-size: 18px;
    }

    .token-modal-content .modal-header svg {
        width: 24px;
        height: 24px;
    }

    .token-value {
        font-size: 14px;
        padding: 15px;
    }

    .token-instructions {
        padding: 15px;
        margin-top: 20px;
    }

    .token-info svg {
        width: 18px;
        height: 18px;
    }

    .copy-token-btn {
        padding: 10px 25px;
        font-size: 14px;
    }

    .copy-token-btn svg {
        width: 16px;
        height: 16px;
    }
}

@media only screen and (max-width: 575px) {
    .contact-form {
        padding: 35px 20px !important;
    }

    .auth-main-title {
        font-size: 24px !important;
    }

    .auth-sub-title {
        font-size: 20px !important;
    }

    .auth-description {
        font-size: 14px !important;
    }
    
    .auth-btn {
        font-size: 14px;
        padding: 14px 18px;
        gap: 6px;
    }

    .auth-btn svg {
        width: 16px;
        height: 16px;
    }

    .auth-form-list input[type="text"],
    .auth-form-list input[type="password"] {
        padding: 14px 18px !important;
        font-size: 14px !important;
    }

    .forgot-password-link {
        font-size: 13px;
    }

    .token-modal-content .modal-body {
        padding: 25px 20px;
    }

    .token-value {
        font-size: 13px;
        padding: 12px;
    }

    .copy-token-btn {
        padding: 9px 20px;
        font-size: 13px;
    }

    .token-instructions {
        padding: 12px;
    }

    .token-instructions p {
        font-size: 14px;
    }

    .token-instructions ul li {
        font-size: 13px;
        padding-right: 20px;
    }
}

/* 8. Loading State */
.auth-btn.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.auth-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 9. Success/Error Messages */
.auth-message {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    animation: slideDown 0.3s ease;
}

.auth-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #4caf50;
}

.auth-message.error {
    background: #ffebee;
    color: #c62828;
    border: 2px solid #f44336;
}

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

/* 10. Close Button RTL Fix */
.modal-header .close {
    margin-left: 0;
    margin-right: auto;
}
