/* صفحه ورود — ترکیب سفید و تم برند (#b83b75) */

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

input, select, textarea, button {
    font-family: inherit;
}

body.login-page {
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 20px 32px;
    background-color: #f8f6f8;
    background-image:
        radial-gradient(ellipse 80% 50% at 100% 0%, rgba(184, 59, 117, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 0% 100%, rgba(150, 47, 95, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, #ffffff 0%, #f5f0f3 100%);
    position: relative;
    overflow-x: hidden;
}

body.login-page::before,
body.login-page::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

body.login-page::before {
    width: 320px;
    height: 320px;
    top: -120px;
    left: -80px;
    background: radial-gradient(circle, rgba(184, 59, 117, 0.07) 0%, transparent 70%);
}

body.login-page::after {
    width: 280px;
    height: 280px;
    bottom: -100px;
    right: -60px;
    background: radial-gradient(circle, rgba(150, 47, 95, 0.06) 0%, transparent 70%);
}

.login-container {
    width: 100%;
    max-width: 1040px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.7s ease;
}

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

/* هدر بالای کارت */
.login-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    width: 100%;
    max-width: 1000px;
}

.login-page-logo {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid var(--color-primary-border);
    padding: 6px;
    box-shadow: var(--shadow-primary-sm);
    overflow: hidden;
}

.login-page-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.login-page-heading h1 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--color-primary-darker);
    margin-bottom: 4px;
    line-height: 1.35;
}

.login-page-heading p {
    font-size: 0.92rem;
    color: #6c757d;
}

/* کارت اصلی */
.login-content {
    display: flex;
    width: 100%;
    max-width: 1000px;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--color-primary-border);
    box-shadow:
        0 4px 6px rgba(107, 34, 68, 0.04),
        0 20px 50px rgba(184, 59, 117, 0.12);
}

.login-content::before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 20px 20px 0 0;
}

.login-content {
    position: relative;
}

/* پنل راهنما — پس‌زمینه روشن با تاکید تم */
.login-info-side {
    flex: 0 0 32%;
    max-width: 340px;
    background: linear-gradient(165deg, var(--color-primary-soft) 0%, #ffffff 55%);
    color: #374151;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid var(--color-primary-border);
}

.login-intro {
    font-size: 0.98rem;
    line-height: 1.75;
    color: #4b5563;
    margin-bottom: 8px;
}

/* پنل فرم — سفید خالص */
.login-box-side {
    flex: 1;
    min-width: 0;
    padding: 40px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.welcome-title {
    margin-bottom: 24px;
}

.welcome-title h2 {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--color-primary-darker);
    margin-bottom: 0;
    position: relative;
    padding-bottom: 12px;
}

.welcome-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 48px;
    height: 3px;
    border-radius: 2px;
    background: var(--gradient-primary);
}

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

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

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    background: #fafafa;
    color: #111827;
}

.form-group input::placeholder {
    color: #9ca3af;
}

.form-group input:hover {
    border-color: var(--color-primary-border);
    background: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: #fff;
    box-shadow: var(--focus-ring);
}

.form-group.field-focused label {
    color: var(--color-primary-dark);
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 8px;
    font-family: inherit;
    box-shadow: var(--shadow-primary-sm);
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-md);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.75;
    cursor: wait;
}

/* باکس راهنما */
.system-info {
    margin-top: 24px;
    padding: 18px 20px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid var(--color-primary-border);
    box-shadow: 0 2px 12px rgba(184, 59, 117, 0.06);
    position: relative;
    overflow: hidden;
}

.system-info::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
    border-radius: 0 4px 4px 0;
}

.system-info h3 {
    color: var(--color-primary-darker);
    margin-bottom: 14px;
    font-size: 1.05rem;
    font-weight: 700;
}

.info-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #4b5563;
    font-size: 0.92rem;
    line-height: 1.55;
}

.info-item strong {
    color: var(--color-primary-dark);
}

/* Alert Messages */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 0.92rem;
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert .icon {
    flex-shrink: 0;
}

.university-info {
    margin-top: 0;
}

.features {
    margin-top: 0;
}

.help-guide-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-primary-sm);
}

.help-guide-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-md);
    color: #fff;
}

/* مودال ویدیو راهنما */
.guide-video-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.guide-video-modal[hidden] {
    display: none;
}

.guide-video-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.guide-video-dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: calc(100vh - 40px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
    overflow: hidden;
    animation: guideVideoFadeIn 0.25s ease-out;
}

@keyframes guideVideoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.guide-video-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
}

.guide-video-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--color-primary-dark, #1e3a5f);
}

.guide-video-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.guide-video-close:hover {
    background: #e5e7eb;
    color: #111827;
}

.guide-video-body {
    padding: 0;
    background: #000;
}

.guide-video-body video {
    display: block;
    width: 100%;
    max-height: calc(100vh - 140px);
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #000;
}

/* فوتر */
.login-footer {
    margin-top: 24px;
    width: 100%;
    max-width: 1000px;
}

.login-footer p {
    color: #6b7280;
    text-align: center;
    font-size: 0.85rem;
}

.support-info {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #f3f4f6;
}

.support-info p {
    text-align: center;
    color: #6b7280;
    font-size: 0.85rem;
    line-height: 1.6;
}

.support-info strong,
.support-info .support-contact-link {
    color: var(--color-primary-dark);
}

.support-info .support-contact-link {
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.support-info .support-contact-link:hover {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

#btnLoading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    body.login-page {
        padding: 16px 14px 24px;
        align-items: flex-start;
    }

    .login-page-header {
        flex-direction: column;
        text-align: center;
        margin-bottom: 20px;
        gap: 12px;
    }

    .login-page-heading h1 {
        font-size: 1.25rem;
    }

    .login-content {
        flex-direction: column;
        max-width: 480px;
        border-radius: 16px;
    }

    .login-info-side {
        flex: none;
        max-width: none;
        border-left: none;
        border-bottom: 1px solid var(--color-primary-border);
        padding: 28px 24px;
    }

    .login-box-side {
        padding: 28px 24px;
    }

    .welcome-title h2 {
        font-size: 1.4rem;
    }
}

@media (max-width: 400px) {
    .login-page-logo {
        width: 48px;
        height: 48px;
        padding: 5px;
    }
}
