:root {
    --ep-primary: #1e2749;
    --ep-secondary: #2a3560;
    --ep-accent: #4f7df3;
    --ep-complement: #e8edf5;
    --ep-success: #10b981;
    --ep-warning: #f59e0b;
    --ep-danger: #ef4444;
    --ep-text: #1a1a2e;
    --ep-text-secondary: #6b7280;
    --ep-bg: #f8fafc;
    --ep-white: #ffffff;
    --ep-border: #e5e7eb;
    --ep-shadow-sm: 0 1px 3px rgba(30, 39, 73, 0.06);
    --ep-shadow-md: 0 4px 12px rgba(30, 39, 73, 0.08);
    --ep-shadow-lg: 0 8px 24px rgba(30, 39, 73, 0.12);
    --ep-shadow-xl: 0 16px 40px rgba(30, 39, 73, 0.16);
    --ep-shadow-2xl: 0 24px 64px rgba(30, 39, 73, 0.20);
    --ep-radius-sm: 8px;
    --ep-radius-md: 12px;
    --ep-radius-lg: 16px;
    --ep-radius-xl: 20px;
    --ep-radius-2xl: 24px;
    --ep-transition: 200ms ease;
    --ep-transition-md: 300ms ease;
}

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

body {
    background-color: var(--ep-bg);
    color: var(--ep-text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'peyda', Tahoma, sans-serif;
}

.auth-layout {
    min-height: 100vh;
    display: flex;
}

.auth-left {
    flex: 0 0 480px;
    max-width: 480px;
    background: var(--ep-white);
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
    overflow-y: auto;
}

.auth-right {
    flex: 1;
    background: linear-gradient(135deg, var(--ep-primary) 0%, var(--ep-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2.5rem;
}

.auth-brand img {
    height: 40px;
}

.auth-heading {
    font-size: 26px;
    font-weight: 700;
    color: var(--ep-primary);
    margin-bottom: 6px;
}

.auth-subheading {
    font-size: 14px;
    color: var(--ep-text-secondary);
    margin-bottom: 2rem;
}

.auth-form-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-footer {
    margin-top: 2rem;
    font-size: 12px;
    color: var(--ep-text-secondary);
    text-align: center;
}

.auth-right-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 3rem;
    max-width: 500px;
}

.auth-right-bg-logo {
    width: 280px;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.auth-right-title {
    color: rgba(255, 255, 255, 0.90);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
}

.auth-right-subtitle {
    color: rgba(255, 255, 255, 0.60);
    font-size: 14px;
    margin-top: 12px;
}
.auth-right-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    padding: 6px 16px;
    color: rgba(255, 255, 255, 0.80);
    font-size: 13px;
    margin-bottom: 2rem;
}

.auth-input-group label {
    font-weight: 600;
    font-size: 13px;
    color: var(--ep-primary);
    margin-bottom: 6px;
    display: block;
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.input-icon {
    position: absolute;
    inset-inline-start: 13px;
    transform: translateY(-50%);
    color: var(--ep-text-secondary);
    pointer-events: none;
    display: flex;
    align-items: center;
    z-index: 1;
}

.input-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

[dir="rtl"] .input-icon {
    left: auto;
    right: 14px;
}

.input-wrapper input[type="text"],
.input-wrapper input[type="password"] {
    width: 100%;
    padding: 12px 44px 12px 44px;
    border: 2px solid var(--ep-border);
    border-radius: var(--ep-radius-sm);
    font-size: 14px;
    color: var(--ep-text);
    background: var(--ep-white);
    transition: border-color var(--ep-transition), box-shadow var(--ep-transition);
    font-family: 'vazir', Tahoma, sans-serif;
    height: 48px;
    line-height: 1;
    position: relative;
}

.input-wrapper input[type="text"]:focus,
.input-wrapper input[type="password"]:focus {
    border-color: var(--ep-primary);
    box-shadow: 0 0 0 3px rgba(30, 39, 73, 0.10);
    outline: none;
}

.input-wrapper input[type="text"]::placeholder,
.input-wrapper input[type="password"]::placeholder {
    color: #b0b7c3;
}

.password-toggle {
    position: absolute;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ep-text-secondary);
    transition: color var(--ep-transition);
    background: none;
    border: none;
    z-index: 2;
    padding: 0;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

[dir="rtl"] .password-toggle {
    right: auto;
    left: 14px;
}

.password-toggle:hover {
    color: var(--ep-primary);
}

.password-toggle i {
    font-size: 18px;
    line-height: 1;
}

.btn-auth-primary {
    width: 100%;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--ep-radius-md);
    background: linear-gradient(135deg, var(--ep-primary) 0%, var(--ep-secondary) 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(30, 39, 73, 0.30);
    transition: transform var(--ep-transition), box-shadow var(--ep-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
    margin-bottom: 25px;
    height: 48px;
}

.btn-auth-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(30, 39, 73, 0.40);
    color: #fff;
}

.btn-auth-secondary {
    width: 100%;
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--ep-radius-md);
    background: transparent;
    border: 2px solid var(--ep-border);
    color: var(--ep-text-secondary);
    cursor: pointer;
    transition: all var(--ep-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-auth-secondary:hover {
    border-color: var(--ep-primary);
    color: var(--ep-primary);
    background: var(--ep-complement);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: var(--ep-text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ep-border);
}

.github-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: 1.5px solid var(--ep-border);
    border-radius: var(--ep-radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--ep-text-secondary);
    background: var(--ep-white);
    text-decoration: none;
    transition: all var(--ep-transition);
    margin-bottom: 0.75rem;
    cursor: pointer;
    font-family: 'peyda', Tahoma, sans-serif;
    height: 48px;
}

.github-btn:hover {
    border-color: var(--ep-primary);
    color: var(--ep-primary);
    background: var(--ep-complement);
    text-decoration: none;
}

.github-btn .gh-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.captcha-wrapper {
    display: flex;
    gap: 10px;
    align-items: stretch;
    width: 100%;
}

.captcha-wrapper input {
    flex: 1;
    height: 48px;
    padding: 12px 14px;
    border: 2px solid var(--ep-border);
    border-radius: var(--ep-radius-sm);
    font-size: 14px;
    color: var(--ep-text);
    background: var(--ep-white);
    transition: border-color var(--ep-transition), box-shadow var(--ep-transition);
    font-family: 'vazir', Tahoma, sans-serif;
}

.captcha-wrapper input:focus {
    border-color: var(--ep-primary);
    box-shadow: 0 0 0 3px rgba(30, 39, 73, 0.10);
    outline: none;
}

.captcha-image-wrapper {
    display: flex;
    align-items: center;
    border-radius: var(--ep-radius-sm);
    overflow: hidden;
    border: 2px solid var(--ep-border);
    background: var(--ep-white);
    height: 48px;
    flex-shrink: 0;
}

.captcha-image-wrapper img {
    height: 100%;
    width: auto;
    min-width: 80px;
    max-width: 140px;
    object-fit: cover;
    cursor: pointer;
}

.captcha-refresh-btn {
    background: linear-gradient(135deg, var(--ep-primary) 0%, var(--ep-secondary) 100%);
    border: none;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity var(--ep-transition);
    height: 100%;
    flex-shrink: 0;
    min-width: 44px;
}

.captcha-refresh-btn:hover {
    opacity: 0.85;
}

.captcha-refresh-btn svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

@media (max-width: 1024px) and (min-width: 768px) {
    .auth-left {
        flex: 0 0 420px;
        max-width: 420px;
    }
}

@media (max-width: 767px) {
    .auth-layout {
        flex-direction: column;
        min-height: 100vh;
    }

    .auth-left {
        flex: 1 1 auto;
        max-width: 100%;
        width: 100%;
        padding: 1.5rem 1.25rem;
    }

    .auth-right {
        display: none;
    }

    .auth-form-card {
        justify-content: flex-start;
    }

    .auth-heading {
        font-size: 22px;
    }

    .auth-right-bg-logo {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .auth-left {
        padding: 1.25rem 1rem;
    }

    .auth-heading {
        font-size: 20px;
    }

    .btn-auth-primary,
    .btn-auth-secondary {
        height: 44px;
        padding: 10px 16px;
        font-size: 14px;
    }

    .input-wrapper input[type="text"],
    .input-wrapper input[type="password"] {
        height: 44px;
        padding: 10px 40px 10px 40px;
        font-size: 13px;
    }

    .input-icon {
        left: 12px;
        width: 16px;
        height: 16px;
    }

    .input-icon svg {
        width: 16px;
        height: 16px;
    }

    .password-toggle {
        right: 12px;
        width: 18px;
        height: 18px;
    }

    .password-toggle i {
        font-size: 16px;
    }

    .github-btn {
        height: 44px;
        padding: 8px 14px;
        font-size: 12px;
    }

    .captcha-wrapper {
        flex-wrap: wrap;
    }

    .captcha-wrapper input {
        height: 44px;
        font-size: 13px;
    }

    .captcha-image-wrapper {
        height: 44px;
        flex: 1 1 100%;
    }

    .captcha-image-wrapper img {
        min-width: 60px;
        max-width: 100px;
    }

    .captcha-refresh-btn {
        min-width: 38px;
        padding: 0 12px;
    }

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

    [dir="rtl"] .input-icon {
        left: auto;
        right: 12px;
    }

    [dir="rtl"] .password-toggle {
        right: auto;
        left: 12px;
    }
}

.redirect-warning {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.20);
    border-radius: var(--ep-radius-md);
    padding: 14px 16px;
    margin-bottom: 1.25rem;
    font-size: 13px;
    color: #991b1b;
}

.text-muted {
    color: var(--ep-text-secondary) !important;
}

.fw-600 {
    font-weight: 600 !important;
}

.font-vazir {
    font-family: 'vazir', Tahoma, sans-serif;
}

.font-peyda {
    font-family: 'peyda', Tahoma, sans-serif;
}

.saber-toast .text {
    font-family: 'peyda', Tahoma, sans-serif;
}

.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.me-2 {
    margin-right: 0.5rem;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}