/* עיצוב דף התחברות */
.login-page {
    min-height: 100vh;
    background: #f4f6f8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: 'Heebo', 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* פריסת שלושה טורים: ימין מידע | טופס | שמאל מידע */
.login-layout {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr 520px 1fr;
    gap: 48px; /* מרחק גדול יותר מהטופס */
    align-items: center; /* מרכז אנכי של כל שלושת האזורים */
}

.info-panel {
    background: transparent;
    padding: 4px;
}

.info-chart {
    width: 100%;
    height: 220px;
    margin-top: 12px;
}

/* פריסת שלושה טורים: מידע ימין | טופס | מידע שמאל */
.login-layout {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr 520px 1fr;
    gap: 28px;
    align-items: start;
}

.info-panel {
    background: transparent;
    padding: 4px;
}

.info-chart {
    width: 100%;
    height: 220px;
    margin-top: 12px;
}

.login-logo-img {
    height: 95px;
    display: block;
    margin: 0 auto 14px auto;
    filter: drop-shadow(0 10px 22px rgba(2,132,199,0.25));
}

.crm-bg {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 15% 20%, rgba(255,255,255,0.25) 0%, transparent 35%),
                      radial-gradient(circle at 85% 65%, rgba(255,255,255,0.15) 0%, transparent 40%);
    pointer-events: none;
}

.login-shell {
    width: 100%;
    max-width: 1100px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 28px;
    align-items: stretch;
}

.brand-panel {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.12);
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.brand-header {
    text-align: right;
}

.brand-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.12));
}

.brand-title {
    color: #0b3b4a;
    font-size: 2rem;
    margin: 10px 0 6px 0;
}

.brand-subtitle {
    color: #0b3b4a;
    opacity: 0.7;
}

.crm-hero {
    position: relative;
    margin-top: 16px;
    height: 180px;
    background:
      linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    /* תרשים קו בסגנון CRM כרקע ויזואלי ברור */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 160'><rect width='800' height='160' fill='none'/><path d='M20 130 L780 130' stroke='%23e5e7eb' stroke-width='1'/><path d='M20 100 L780 100' stroke='%23e5e7eb' stroke-width='1'/><path d='M20 70 L780 70' stroke='%23e5e7eb' stroke-width='1'/><path d='M20 120 L140 92 L260 108 L380 74 L500 88 L620 62 L780 82' fill='none' stroke='%230ea5e9' stroke-width='3' stroke-linecap='round'/><circle cx='140' cy='92' r='4' fill='%230ea5e9'/><circle cx='380' cy='74' r='4' fill='%230ea5e9'/><circle cx='620' cy='62' r='4' fill='%230ea5e9'/></svg>");
    background-repeat: no-repeat;
    background-position: center 70%;
    background-size: 92% auto;
}

.crm-hero::before { content: ''; opacity: 0; }

.crm-hero::after { content: ''; opacity: 0; }

.brand-features {
    list-style: none;
    display: grid;
    gap: 10px;
    margin: 10px 0 0 0;
    padding: 0;
}

.brand-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0b3b4a;
}

.brand-features i {
    color: #0ea5e9;
}


.login-shell .login-container {
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
    padding: 36px 32px;
}
.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 520px;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color), var(--success-color));
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.6rem;
    font-weight: 800;
    box-shadow: 0 10px 28px rgba(2,132,199,0.35);
}

.login-title {
    color: #0b3b4a;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 6px;
    min-height: 40px; /* גובה קבוע למניעת קפיצות */
}

/* אפקט הקלדה */
.typewriter-text {
    display: inline-block;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.typewriter-text::after {
    content: '|';
    position: absolute;
    right: -2px;
    color: var(--primary-color);
    animation: blink 1s infinite;
    font-weight: normal;
}

.typewriter-text.typing {
    animation: typing 3s steps(30, end) 0.5s 1 normal both;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

.login-subtitle {
    color: #64748b;
    font-size: 0.95rem;
}

.login-form {
    direction: rtl;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.field-error {
    min-height: 20px; /* גובה קבוע למניעת קפיצות */
    margin-top: 5px;
    font-size: 14px;
    color: #dc2626;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.field-error.show {
    opacity: 1;
}

.input-row {
    position: relative;
    display: flex;
    align-items: center; /* ממרכז אנכית את האייקונים */
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
    outline: none;
}

.form-input.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.form-input.error:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.input-row .form-input:focus ~ .form-icon {
    color: var(--secondary-color);
}

.form-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: var(--text-secondary);
    transition: color 0.3s ease;
    font-size: 20px; /* הגדלת האייקון מעט */
}

.password-toggle {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

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

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #6BAD27, #6BAD27);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    font-family: 'Heebo', 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif; /* הוספת פונט Heebo */
    letter-spacing: .3px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.28);
}

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

.login-btn.loading {
    pointer-events: none;
}

.login-btn .btn-text {
    transition: opacity 0.3s ease;
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn .spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    opacity: 0;
}

.login-btn.loading .spinner {
    opacity: 1;
}

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

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--secondary-color);
}

.forgot-password {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #0b3b4a;
    text-decoration: underline;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.5s ease-in-out;
}

.error-message.success {
    background: #f0f9f0;
    border: 1px solid #c3e6c3;
    color: #2d6a2d;
}

@keyframes shake {
    0%, 20%, 40%, 60%, 80%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
}

/* מודל שינוי סיסמה */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

.modal-container {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.change-password-modal .modal-container {
    max-width: 550px;
}

.modal-header {
    padding: 30px 30px 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.modal-title-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.modal-icon {
    font-size: 2rem;
    opacity: 0.9;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.modal-body {
    padding: 30px;
}

.welcome-section {
    text-align: center;
    margin-bottom: 30px;
}

.welcome-text {
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 15px;
}

.security-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 12px;
    color: #4a5568;
    border-left: 4px solid #667eea;
}

.security-message i {
    color: #667eea;
    font-size: 1.2rem;
}

.change-password-form {
    direction: rtl;
}

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

.change-password-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
}

.password-requirements {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    border: 1px solid #e2e8f0;
}

.password-requirements h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    color: #4a5568;
    font-size: 1rem;
    font-weight: 600;
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    color: #718096;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.password-requirements li i {
    font-size: 0.8rem;
    color: #cbd5e0;
    transition: all 0.2s ease;
}

.password-requirements li.valid {
    color: #38a169;
}

.password-requirements li.valid i {
    color: #38a169;
}

.password-requirements li.invalid {
    color: #e53e3e;
}

.password-requirements li.invalid i {
    color: #e53e3e;
}

.modal-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.change-password-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.change-password-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

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

.change-password-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.change-password-btn .spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.change-password-btn.loading .spinner {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* התאמה למובייל */
@media (max-width: 600px) {
    .modal-container {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 20px 20px 15px 20px;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-title-section {
        flex-direction: column;
        gap: 10px;
    }
}

/* רספונסיביות */
@media (max-width: 480px) {
    .login-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .info-panel { display: none; }
    .login-container {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .form-input {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .login-btn {
        padding: 12px;
        font-size: 14px;
    }
}
