/* CRM Dashboard Style Login Page */

.crm-login-container {
    min-height: 100vh;
    display: flex;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8fafc;
}

/* Left Info Panel */
.crm-info-panel {
    flex: 1;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 60px 50px;
    position: relative;
    overflow: hidden;
}

.crm-info-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.info-content {
    position: relative;
    z-index: 1;
}

.logo-section {
    margin-bottom: 60px;
}

.logo-icon {
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease-out;
}

.company-name {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.company-tagline {
    font-size: 16px;
    color: #94a3b8;
    margin: 0;
    font-weight: 400;
}

.stats-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 50px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.3s;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(44, 80, 59, 0.2);
    border-radius: 10px;
    color: #D9E08F;
    flex-shrink: 0;
}

.stat-content h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #ffffff;
}

.stat-content p {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #cbd5e1;
    font-size: 15px;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.feature-item:nth-child(1) {
    animation-delay: 0.4s;
}

.feature-item:nth-child(2) {
    animation-delay: 0.5s;
}

.feature-item:nth-child(3) {
    animation-delay: 0.6s;
}

.feature-item svg {
    color: #D9E08F;
    flex-shrink: 0;
}

.info-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    margin-top: auto;
}

/* Right Login Panel */
.crm-login-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #ffffff;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    animation: fadeIn 0.6s ease-out;
}

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

.login-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.login-header p {
    font-size: 15px;
    color: #64748b;
    margin: 0;
}

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
}

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

.alert-error svg {
    flex-shrink: 0;
    color: #dc2626;
}

.alert span {
    flex: 1;
}

.crm-login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.form-label svg {
    color: #64748b;
    flex-shrink: 0;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input,
.input-wrapper #id_username,
.input-wrapper #id_password {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #1e293b;
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.input-wrapper input:focus,
.input-wrapper #id_username:focus,
.input-wrapper #id_password:focus {
    outline: none;
    border-color: #2C503B;
    box-shadow: 0 0 0 3px rgba(44, 80, 59, 0.1);
    background: #ffffff;
}

.input-wrapper input::placeholder,
.input-wrapper #id_username::placeholder,
.input-wrapper #id_password::placeholder {
    color: #94a3b8;
}

.field-errors {
    color: #dc2626;
    font-size: 13px;
    margin-top: 4px;
}

.field-errors ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -8px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2C503B;
}

.forgot-password {
    color: #2C503B;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: #3a6b4f;
    text-decoration: underline;
}

.crm-login-button {
    width: 100%;
    padding: 16px 24px;
    background: #2C503B;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(44, 80, 59, 0.2);
}

.crm-login-button:hover {
    background: #3a6b4f;
    box-shadow: 0 4px 12px rgba(44, 80, 59, 0.3);
    transform: translateY(-1px);
}

.crm-login-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(44, 80, 59, 0.2);
}

.crm-login-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 80, 59, 0.2);
}

.crm-login-button svg {
    transition: transform 0.2s ease;
}

.crm-login-button:hover svg {
    transform: translateX(3px);
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 14px;
    color: #64748b;
}

.login-footer a {
    color: #2C503B;
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .crm-login-container {
        flex-direction: column;
    }
    
    .crm-info-panel {
        padding: 40px 30px;
        min-height: auto;
    }
    
    .logo-section {
        margin-bottom: 40px;
    }
    
    .stats-section {
        flex-direction: row;
        overflow-x: auto;
        margin-bottom: 30px;
    }
    
    .stat-card {
        min-width: 200px;
        flex-direction: column;
        text-align: center;
    }
    
    .features-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .info-footer {
        margin-top: 30px;
    }
}

@media (max-width: 768px) {
    .crm-info-panel {
        padding: 30px 20px;
    }
    
    .company-name {
        font-size: 28px;
    }
    
    .stats-section {
        flex-direction: column;
    }
    
    .stat-card {
        width: 100%;
    }
    
    .features-list {
        flex-direction: column;
    }
    
    .crm-login-panel {
        padding: 30px 20px;
    }
    
    .login-wrapper {
        max-width: 100%;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .crm-info-panel {
        padding: 24px 16px;
    }
    
    .logo-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .company-name {
        font-size: 24px;
    }
    
    .stat-content h3 {
        font-size: 24px;
    }
    
    .crm-login-panel {
        padding: 24px 16px;
    }
    
    .login-header h2 {
        font-size: 24px;
    }
    
    .input-wrapper input,
    .input-wrapper #id_username,
    .input-wrapper #id_password {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Reset default Django admin styles */
.crm-login-container * {
    box-sizing: border-box;
}

.crm-login-container input[type="text"],
.crm-login-container input[type="password"],
.crm-login-container input[type="email"] {
    margin: 0;
    padding: 14px 16px;
    font-size: 15px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #1e293b;
    transition: all 0.2s ease;
    font-family: inherit;
    width: 100%;
}

.crm-login-container input[type="text"]:focus,
.crm-login-container input[type="password"]:focus,
.crm-login-container input[type="email"]:focus {
    outline: none;
    border-color: #2C503B;
    box-shadow: 0 0 0 3px rgba(44, 80, 59, 0.1);
    background: #ffffff;
}

