/**
 * Client Management - Login Page Styles
 * Version: 1.0.0
 * 
 * पूरी तरह से आइसोलेटेड CSS - केवल लॉगिन पेज पर लागू
 */

/* ===== बेस वेरिएबल्स ===== */
.cm-login-scope {
    --cm-primary: #667eea;
    --cm-primary-dark: #5a67d8;
    --cm-secondary: #764ba2;
    --cm-success: #48bb78;
    --cm-error: #f56565;
    --cm-warning: #ecc94b;
    --cm-text-dark: #2d3748;
    --cm-text-light: #718096;
    --cm-border: #e2e8f0;
    --cm-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --cm-shadow-sm: 0 10px 40px -15px rgba(0, 0, 0, 0.3);
    --cm-radius: 2rem;
    --cm-radius-sm: 1.2rem;
    --cm-radius-circle: 3rem;
    --cm-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== रीसेट ===== */
.cm-login-scope,
.cm-login-scope *,
.cm-login-scope *::before,
.cm-login-scope *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.cm-login-scope {
    display: block;
    width: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
}

/* ===== मुख्य कंटेनर ===== */
.cm-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1.5rem;
    background: linear-gradient(145deg, var(--cm-primary) 0%, var(--cm-secondary) 100%);
}

.cm-login-card {
    max-width: 460px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow), var(--cm-shadow-sm);
    padding: 2.8rem 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: cmFadeIn 0.6s ease-out;
}

/* ===== हेडर ===== */
.cm-login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.cm-login-header h2 {
    font-size: 2.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--cm-primary) 0%, var(--cm-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.cm-login-header h2 i {
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cm-login-subtitle {
    color: var(--cm-text-light);
    font-size: 1rem;
    position: relative;
    display: inline-block;
    padding: 0 1.5rem;
}

.cm-login-subtitle::before,
.cm-login-subtitle::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cm-primary), transparent);
}

.cm-login-subtitle::before { left: -30px; }
.cm-login-subtitle::after { right: -30px; }

/* ===== फॉर्म ===== */
.cm-login-form {
    margin-bottom: 2rem;
}

.cm-form-group {
    margin-bottom: 1.8rem;
    animation: cmSlideIn 0.5s ease-out;
    animation-fill-mode: both;
}

.cm-form-group:nth-child(1) { animation-delay: 0.1s; }
.cm-form-group:nth-child(2) { animation-delay: 0.2s; }

.cm-form-group label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cm-text-dark);
    margin-bottom: 0.5rem;
}

.cm-form-group label i {
    color: var(--cm-primary);
    font-size: 1rem;
    width: 1.2rem;
}

.cm-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.cm-input-icon {
    position: absolute;
    left: 1rem;
    color: #a0aec0;
    z-index: 1;
}

.cm-input-field {
    width: 100%;
    padding: 1rem 1rem 1rem 2.8rem;
    font-size: 1rem;
    background: white;
    border: 2px solid var(--cm-border);
    border-radius: var(--cm-radius-sm);
    outline: none;
    transition: var(--cm-transition);
    color: var(--cm-text-dark);
}

.cm-input-field:focus {
    border-color: var(--cm-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.cm-input-field.error {
    border-color: var(--cm-error);
    background-color: #fff5f5;
}

.cm-password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.1rem;
    transition: var(--cm-transition);
}

.cm-password-toggle:hover {
    color: var(--cm-primary);
    transform: scale(1.1);
}

/* ===== फॉर्म एक्स्ट्रा ===== */
.cm-form-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.8rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.cm-remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--cm-text-light);
}

.cm-remember-me input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 0.3rem;
    border: 2px solid #cbd5e0;
    appearance: none;
    cursor: pointer;
    position: relative;
}

.cm-remember-me input[type="checkbox"]:checked {
    background: var(--cm-primary);
    border-color: var(--cm-primary);
}

.cm-remember-me input[type="checkbox"]:checked::before {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 0.8rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.cm-forgot-password {
    color: var(--cm-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--cm-transition);
}

.cm-forgot-password:hover {
    color: var(--cm-secondary);
    text-decoration: underline;
}

/* ===== लॉगिन बटन ===== */
.cm-login-button {
    width: 100%;
    background: linear-gradient(135deg, var(--cm-primary) 0%, var(--cm-secondary) 100%);
    color: white;
    border: none;
    padding: 1.2rem 2rem;
    border-radius: var(--cm-radius-circle);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: var(--cm-transition);
    box-shadow: 0 10px 20px -5px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.cm-login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(102, 126, 234, 0.6);
}

.cm-login-button.loading {
    opacity: 0.8;
    cursor: not-allowed;
    color: transparent;
}

.cm-login-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: cmSpin 0.6s linear infinite;
}

/* ===== रजिस्टर लिंक ===== */
.cm-register-link {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px dashed var(--cm-border);
}

.cm-register-link p {
    color: var(--cm-text-light);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.cm-register-link a {
    color: var(--cm-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    border-radius: var(--cm-radius-circle);
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    transition: var(--cm-transition);
}

.cm-register-link a:hover {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    color: var(--cm-secondary);
    transform: translateY(-2px);
}

/* ===== मैसेज ===== */
.cm-message {
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.95rem;
    animation: cmSlideIn 0.4s ease-out;
}

.cm-message.success {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #22543d;
    border-left: 4px solid var(--cm-success);
}

.cm-message.error {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #742a2a;
    border-left: 4px solid var(--cm-error);
    animation: cmShake 0.5s ease-in-out;
}

.cm-message.warning {
    background: linear-gradient(135deg, #feebc8 0%, #fbd38d 100%);
    color: #744210;
    border-left: 4px solid var(--cm-warning);
}

/* ===== सिक्योरिटी बैज ===== */
.cm-security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    color: var(--cm-text-light);
    font-size: 0.85rem;
}

.cm-security-badge i {
    color: var(--cm-success);
}

/* ===== एनिमेशन ===== */
@keyframes cmFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cmSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes cmShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes cmSpin {
    to { transform: rotate(360deg); }
}

/* ===== रिस्पॉन्सिव ===== */
@media (max-width: 768px) {
    .cm-login-card {
        max-width: 400px;
        padding: 2rem 1.8rem;
    }
    
    .cm-login-header h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .cm-login-container {
        padding: 1rem;
    }
    
    .cm-login-card {
        padding: 1.8rem 1.2rem;
        border-radius: 1.5rem;
    }
    
    .cm-login-header h2 {
        font-size: 1.8rem;
    }
    
    .cm-input-field {
        padding: 0.9rem 0.9rem 0.9rem 2.5rem;
    }
    
    .cm-form-extras {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cm-forgot-password {
        align-self: flex-end;
    }
    
    .cm-login-button {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

/* ===== प्रिंट ===== */
@media print {
    .cm-login-container {
        background: none;
        min-height: auto;
        padding: 0;
    }
    
    .cm-login-card {
        box-shadow: none;
        border: 1px solid #000;
        background: white;
    }
    
    .cm-login-button,
    .cm-register-link,
    .cm-security-badge {
        display: none;
    }
}