/* Neumorphism Login Form - RTL/Persian - Optimized */

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

body {
    font-family: 'Vazir', 'Vazirmatn', Tahoma, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
    background: linear-gradient(135deg, #0d1f3c 0%, #1a2d56 50%, #0d1f3c 100%);
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
    position: relative;
    overflow: hidden;
    will-change: background-position;
}

body::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(100, 149, 237, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(65, 105, 225, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Error and Info Messages */
.error-message {
    background: rgba(255, 59, 92, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 24px;
    color: #ff3b5c;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-message i {
    font-size: 18px;
}

.info-message {
    background: rgba(255, 193, 7, 0.15);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 24px;
    color: #856404;
    font-size: 14px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles */
:focus-visible {
    outline: 2px solid #6c7293;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ====== Two-panel layout (login.html specific) ====== */

.login-wrapper {
    width: 100%;
    max-width: 800px;
    display: flex;
    align-items: stretch;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(32, 77, 175, 0.15);
}

.login-image {
    flex: 1;
    background: linear-gradient(135deg, #1f376c 0%, #204daf 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-image::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.login-image-content {
    text-align: center;
    color: white;
    z-index: 1;
    position: relative;
}

.customer-logo {
    max-width: 120px;
    max-height: 50px;
    object-fit: contain;
    margin-bottom: 1rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    padding: 6px 12px;
}

.login-image-content > i {
    font-size: 6rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.login-image-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.login-image-content p {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.6;
}

.login-image-content .hero-main {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.7;
    margin-bottom: 0;
}

.about-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255,255,255,0.1);
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    transition: all 0.3s ease;
    white-space: nowrap;
    margin-top: 8px;
}

.about-link:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.25);
}

.about-link i {
    font-size: 0.7rem;
}

.login-form-side {
    flex: 1;
    background: #ffffff;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: #1f376c;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #6c7293;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.neu-input {
    position: relative;
    background: #f0f4f8;
    border-radius: 12px;
    box-shadow: inset 4px 4px 10px #d1d9e6, inset -4px -4px 10px #ffffff;
    transition: box-shadow 0.3s ease;
}

.neu-input:focus-within {
    box-shadow: inset 2px 2px 5px #d1d9e6, inset -2px -2px 5px #ffffff;
}

.neu-input input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 14px 18px;
    padding-right: 45px;
    color: #3d4468;
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.neu-input input::placeholder {
    color: transparent;
}

.neu-input label {
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    color: #9499b7;
    font-size: 0.9rem;
    pointer-events: none;
    transition: all 0.3s ease;
}

.neu-input input:focus + label,
.neu-input input:not(:placeholder-shown) + label {
    top: 6px;
    font-size: 0.65rem;
    color: #204daf;
    transform: translateY(0);
}

.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #9499b7;
    transition: color 0.3s ease;
}

.input-icon svg {
    width: 100%;
    height: 100%;
}

.neu-input:focus-within .input-icon {
    color: #204daf;
}

.password-group {
    padding-left: 45px;
}

.neu-toggle {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9499b7;
    transition: color 0.3s ease;
}

.neu-toggle:hover {
    color: #204daf;
}

.neu-toggle svg {
    width: 16px;
    height: 16px;
}

.eye-closed { display: none; }
.neu-toggle.show-password .eye-open { display: none; }
.neu-toggle.show-password .eye-closed { display: block; }

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 12px;
}

.remember-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.remember-wrapper input[type="checkbox"] {
    display: none;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    color: #6c7293;
    font-size: 0.85rem;
    font-weight: 500;
}

.neu-checkbox {
    width: 20px;
    height: 20px;
    background: #f0f4f8;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 2px 2px 5px #d1d9e6, inset -2px -2px 5px #ffffff;
    transition: box-shadow 0.3s ease;
}

.neu-checkbox svg {
    width: 12px;
    height: 12px;
    color: #00c896;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.remember-wrapper input[type="checkbox"]:checked + .checkbox-label .neu-checkbox svg {
    opacity: 1;
    transform: scale(1);
}

.forgot-link {
    color: #204daf;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.3s ease;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}

.forgot-link:hover {
    color: #1a2d56;
}

/* Forgot Password Slide Panel */
.forgot-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-100%);
    transition: all 0.4s ease;
    z-index: 10;
    border-radius: 20px 0 0 20px;
    overflow-y: auto;
}

.forgot-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
}

.forgot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.forgot-header h3 {
    color: #1f376c;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.close-forgot {
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f4f8;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c7293;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.close-forgot:hover {
    background: #e3e6f0;
    color: #1f376c;
}

.forgot-description {
    color: #6c7293;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.back-to-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6c7293;
    text-decoration: none;
    font-size: 0.85rem;
    margin-top: 1rem;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    transition: color 0.3s;
}

.back-to-login:hover {
    color: #204daf;
}

.neu-button {
    width: 100%;
    background: linear-gradient(135deg, #1f376c 0%, #204daf 100%);
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    box-shadow: 0 8px 20px rgba(32, 77, 175, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
    overflow: hidden;
}

.neu-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;
}

.neu-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(32, 77, 175, 0.4);
}

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

.neu-button:active {
    transform: translateY(0);
}

.btn-text {
    position: relative;
    z-index: 1;
}

.signup-link {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e3e6f0;
}

.signup-link p {
    color: #9499b7;
    font-size: 0.9rem;
    margin: 0;
}

.signup-link a {
    color: #204daf;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.signup-link a:hover {
    color: #1a2d56;
}

.register-link-btn {
    background: none;
    border: none;
    color: #204daf;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.3s ease;
}

.register-link-btn:hover {
    color: #1a2d56;
    text-decoration: underline;
}

/* Register Slide Panel */
.register-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-100%);
    transition: all 0.4s ease;
    z-index: 10;
    border-radius: 20px 0 0 20px;
    overflow-y: auto;
}

.register-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
}

.register-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.register-header h3 {
    color: #1f376c;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.close-register {
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f4f8;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c7293;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.close-register:hover {
    background: #e3e6f0;
    color: #1f376c;
}

.register-form-row {
    display: flex;
    gap: 12px;
}

.register-form-row > div {
    flex: 1;
}

.register-btn {
    background: linear-gradient(135deg, #1f376c 0%, #204daf 100%);
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(32, 77, 175, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
    width: 100%;
    margin-top: 0.5rem;
}

.register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(32, 77, 175, 0.4);
}

.register-info {
    background: #e8f4fd;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: #0c5460;
    line-height: 1.5;
}

.back-to-login-from-register {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6c7293;
    text-decoration: none;
    font-size: 0.85rem;
    margin-top: 1rem;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    transition: color 0.3s;
}

.back-to-login-from-register:hover {
    color: #204daf;
}

/* Desktop: keep subtle icon animation */
@media (min-width: 769px) {
    .login-image-content > i {
        animation: iconPulse 3s ease-in-out infinite;
    }
    @keyframes iconPulse {
        0%, 100% { transform: scale(1); opacity: 0.9; }
        50% { transform: scale(1.05); opacity: 1; }
    }
}

/* ====== Mobile performance optimizations ====== */

@media (max-width: 768px) {
    body {
        animation: none;
        background: #0d1f3c;
        padding: 16px;
        overflow: auto;
    }
    body::before { background: none; }

    .login-wrapper {
        flex-direction: column;
        max-width: 420px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

    .login-image {
        padding: 1.5rem;
        min-height: 140px;
    }

    .login-image-content > i {
        font-size: 2rem;
        margin-bottom: 0.75rem;
        animation: none;
    }

    .login-image-content h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .login-image-content .hero-main {
        font-size: 0.8rem;
    }

    .about-link {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .about-link i {
        font-size: 0.6rem;
    }

    .customer-logo {
        max-width: 90px;
        max-height: 35px;
        margin-bottom: 0.5rem;
    }

    .login-form-side {
        padding: 1.5rem;
    }

    .login-header h2 {
        font-size: 1.4rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .forgot-panel,
    .register-panel {
        border-radius: 0;
    }

    .neu-input {
        box-shadow: inset 4px 4px 8px #d1d9e6, inset -4px -4px 8px #ffffff;
    }

    .neu-input:focus-within {
        box-shadow: inset 2px 2px 4px #d1d9e6, inset -2px -2px 4px #ffffff;
    }

    .neu-button {
        box-shadow: 0 6px 15px rgba(32, 77, 175, 0.25);
    }

    .neu-button:hover {
        transform: none;
        box-shadow: 0 6px 15px rgba(32, 77, 175, 0.25);
    }

    .neu-checkbox {
        box-shadow: inset 2px 2px 5px #d1d9e6, inset -2px -2px 5px #ffffff;
    }

    .neu-toggle {
        box-shadow: none;
    }
}

@media (max-width: 480px) {
    body { padding: 12px; }
    .login-wrapper { border-radius: 0; }
    .login-form-side { padding: 1.25rem; }
    .login-image { padding: 1.25rem; min-height: 120px; }
    .login-header h2 { font-size: 1.3rem; }
    .neu-input input { padding: 14px 16px; padding-right: 40px; }
    .neu-input label { right: 40px; }
}
