/* ==========================================
   Modern Login Page - Light & Dark Mode
   Primary Color: Sky Blue (#0ea5e9)
   Created: 2025-10-19
   ========================================== */

/* ========== Persian Fonts ========== */
@font-face {
    font-family: 'byekan';
    src: url('../../fonts/byekan.eot');
    src: url('../../fonts/byekan.eot?#iefix') format('embedded-opentype'),
         url('../../fonts/byekan.woff') format('woff'),
         url('../../fonts/byekan.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'WYekan';
    src: url('../../fonts/YekanWeb-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'WYekan';
    src: url('../../fonts/YekanWeb-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

/* ========== Reset & Base Styles ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'byekan', 'WYekan', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow: hidden;
}

/* ========== Login Wrapper ========== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    transition: background 0.5s ease;
}

[data-theme="dark"] .login-wrapper {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* ========== Background Decorations ========== */
.login-bg-decoration {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

.decoration-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #0ea5e9 0%, #7dd3fc 100%);
    top: -250px;
    right: -250px;
    animation-delay: 0s;
}

.decoration-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    bottom: -200px;
    left: -200px;
    animation-delay: 5s;
}

.decoration-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    top: 50%;
    right: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    75% {
        transform: translate(20px, 30px) scale(1.05);
    }
}

/* ========== Theme Toggle Button ========== */
.login-theme-toggle {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 100;
}

.theme-toggle-login {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.theme-toggle-login:hover {
    transform: scale(1.1) rotate(10deg);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.theme-toggle-login:active {
    transform: scale(0.95);
}

[data-theme="dark"] .theme-toggle-login {
    background: rgba(3, 218, 198, 0.15);
    border-color: rgba(3, 218, 198, 0.3);
}

[data-theme="dark"] .theme-toggle-login:hover {
    background: rgba(3, 218, 198, 0.25);
}

/* Toggle icons visibility */
[data-theme="light"] .theme-icon-moon {
    display: inline-block;
}

[data-theme="light"] .theme-icon-sun {
    display: none;
}

[data-theme="dark"] .theme-icon-moon {
    display: none;
}

[data-theme="dark"] .theme-icon-sun {
    display: inline-block;
}

/* ========== Login Container ========== */
.login-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 10;
    animation: slideUp 0.6s ease-out;
}

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

/* ========== Login Card ========== */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.login-card:hover {
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.6);
    transform: translateY(-5px);
}

[data-theme="dark"] .login-card {
    background: rgba(44, 44, 44, 0.95);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .login-card:hover {
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* ========== Login Header ========== */
.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(14, 165, 233, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(14, 165, 233, 0.4);
    }
}

[data-theme="dark"] .login-logo {
    background: linear-gradient(135deg, #03DAC6 0%, #018786 100%);
    box-shadow: 0 10px 30px rgba(3, 218, 198, 0.3);
}

.logo-icon {
    font-size: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
    font-family: 'byekan', 'WYekan', Arial, sans-serif;
}

[data-theme="dark"] .login-title {
    color: rgba(255, 255, 255, 0.87);
}

.login-subtitle {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
    font-family: 'byekan', 'WYekan', Arial, sans-serif;
}

[data-theme="dark"] .login-subtitle {
    color: rgba(255, 255, 255, 0.60);
}

/* ========== Alerts Section ========== */
.login-alerts {
    margin-bottom: 30px;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    animation: slideIn 0.4s ease-out;
    border: 2px solid;
}

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

.login-alert:last-child {
    margin-bottom: 0;
}

.alert-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.alert-content {
    flex: 1;
}

.alert-content strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    font-family: 'byekan', 'WYekan', Arial, sans-serif;
}

.alert-content p {
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
    font-family: 'byekan', 'WYekan', Arial, sans-serif;
}

/* Alert Variants */
.login-alert-warning {
    background: #fef3c7;
    border-color: #fbbf24;
    color: #92400e;
}

[data-theme="dark"] .login-alert-warning {
    background: rgba(255, 152, 0, 0.12);
    border-color: #FF9800;
    color: #FFB74D;
}

.login-alert-info {
    background: #dbeafe;
    border-color: #60a5fa;
    color: #1e40af;
}

[data-theme="dark"] .login-alert-info {
    background: rgba(33, 150, 243, 0.12);
    border-color: #2196F3;
    color: #64B5F6;
}

/* ========== Form Styles ========== */
.login-form {
    margin-bottom: 30px;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    font-family: 'byekan', 'WYekan', Arial, sans-serif;
}

[data-theme="dark"] .form-label {
    color: rgba(255, 255, 255, 0.87);
}

.label-icon {
    font-size: 16px;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    height: 52px;
    padding: 0 50px 0 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    color: #1f2937;
    background: #ffffff;
    transition: all 0.3s ease;
    outline: none;
    font-family: 'byekan', 'WYekan', Arial, sans-serif;
}

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

.form-input:hover {
    border-color: #38bdf8;
}

.form-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
    background: #fefefe;
}

[data-theme="dark"] .form-input {
    background: #2C2C2C;
    border-color: rgba(255, 255, 255, 0.20);
    color: rgba(255, 255, 255, 0.87);
}

[data-theme="dark"] .form-input::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

[data-theme="dark"] .form-input:hover {
    border-color: #03DAC6;
}

[data-theme="dark"] .form-input:focus {
    border-color: #03DAC6;
    box-shadow: 0 0 0 4px rgba(3, 218, 198, 0.15);
    background: #383838;
}

/* Input Icon */
.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0.5;
    pointer-events: none;
    transition: all 0.3s ease;
}

.input-wrapper.focused .input-icon {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    opacity: 0.6;
    z-index: 10;
}

.password-toggle:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .password-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Captcha Group */
.captcha-group {
    margin-bottom: 24px;
}

.captcha-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    border: 2px dashed #e5e7eb;
}

[data-theme="dark"] .captcha-wrapper {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ========== Login Button ========== */
.login-button {
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.3);
    position: relative;
    overflow: hidden;
    font-family: 'byekan', 'WYekan', Arial, sans-serif;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.login-button:hover::before {
    left: 100%;
}

.login-button:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(14, 165, 233, 0.4);
}

.login-button:active {
    transform: translateY(0);
    box-shadow: 0 5px 20px rgba(14, 165, 233, 0.3);
}

[data-theme="dark"] .login-button {
    background: linear-gradient(135deg, #03DAC6 0%, #018786 100%);
    color: #000000;
    box-shadow: 0 10px 30px rgba(3, 218, 198, 0.3);
}

[data-theme="dark"] .login-button:hover {
    background: linear-gradient(135deg, #018786 0%, #00574B 100%);
    box-shadow: 0 15px 40px rgba(3, 218, 198, 0.4);
}

.button-icon {
    font-size: 20px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

.button-text {
    font-size: 16px;
    letter-spacing: 0.3px;
}

.button-arrow {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.login-button:hover .button-arrow {
    transform: translateX(-5px);
}

/* Loading State */
.login-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.login-button.loading .button-icon {
    animation: spin 1s linear infinite;
}

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

/* ========== Login Footer ========== */
.login-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .login-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.footer-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    font-family: 'byekan', 'WYekan', Arial, sans-serif;
}

[data-theme="dark"] .footer-text {
    color: rgba(255, 255, 255, 0.60);
}

.footer-icon {
    font-size: 16px;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .login-wrapper {
        padding: 16px;
    }
    
    .login-theme-toggle {
        top: 20px;
        left: 20px;
    }
    
    .theme-toggle-login {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    .login-card {
        padding: 32px 24px;
        border-radius: 20px;
    }
    
    .login-logo {
        width: 70px;
        height: 70px;
        border-radius: 16px;
    }
    
    .logo-icon {
        font-size: 35px;
    }
    
    .login-title {
        font-size: 26px;
    }
    
    .login-subtitle {
        font-size: 14px;
    }
    
    .form-input {
        height: 48px;
        font-size: 14px;
    }
    
    .login-button {
        height: 52px;
        font-size: 15px;
    }
    
    .decoration-1,
    .decoration-2,
    .decoration-3 {
        opacity: 0.08;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px;
    }
    
    .login-header {
        margin-bottom: 30px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .alert-icon {
        font-size: 20px;
    }
    
    .alert-content strong {
        font-size: 13px;
    }
    
    .alert-content p {
        font-size: 12px;
    }
}

/* ========== Smooth Transitions ========== */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ========== Prevent Flash ========== */
html:not([data-theme]) .login-wrapper {
    opacity: 0;
}

html[data-theme] .login-wrapper {
    opacity: 1;
    transition: opacity 0.3s ease;
}

