/* ==========================================================================
   MOAYESTAND - LOGIN PAGE THEME ONLY
   Version: 4.1
   Note: Only login page styling - backoffice uses default template styles
   ========================================================================== */

/* ==========================================================================
   1. GOOGLE FONTS
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   2. CSS VARIABLES (for login page only)
   ========================================================================== */
:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --success: #059669;
    --success-light: #d1fae5;
    --error: #dc2626;
    --error-light: #fee2e2;
}

/* ==========================================================================
   3. LOADER (keep modern loader)
   ========================================================================== */
.loader {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader > div {
    display: flex;
    gap: 2px;
}

.loader span {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Inter', sans-serif;
    animation: loaderFade 1.5s ease-in-out infinite;
}

.loader span:nth-child(1) { animation-delay: 0s; }
.loader span:nth-child(2) { animation-delay: 0.05s; }
.loader span:nth-child(3) { animation-delay: 0.1s; }
.loader span:nth-child(4) { animation-delay: 0.15s; }
.loader span:nth-child(5) { animation-delay: 0.2s; }
.loader span:nth-child(6) { animation-delay: 0.25s; }
.loader span:nth-child(7) { animation-delay: 0.3s; }
.loader span:nth-child(8) { animation-delay: 0.35s; }
.loader span:nth-child(9) { animation-delay: 0.4s; }
.loader span:nth-child(10) { animation-delay: 0.45s; }
.loader span:nth-child(11) { animation-delay: 0.5s; }
.loader span:nth-child(12) { animation-delay: 0.55s; }
.loader span:nth-child(13) { animation-delay: 0.6s; }
.loader span:nth-child(14) { animation-delay: 0.65s; }
.loader span:nth-child(15) { animation-delay: 0.7s; }
.loader span:nth-child(16) { animation-delay: 0.75s; }
.loader span:nth-child(17) { animation-delay: 0.8s; }
.loader span:nth-child(18) { animation-delay: 0.85s; }

@keyframes loaderFade {
    0%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* ==========================================================================
   4. LOGIN PAGE - MODERN SPLIT SCREEN
   ========================================================================== */
body.cm-login {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    margin: 0;
    padding: 0;
    display: flex;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Left Panel */
.login-left-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 50%;
    height: 100vh;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.login-left-content {
    text-align: center;
    max-width: 420px;
}

.login-brand {
    margin-bottom: 2.5rem;
}

.login-logo {
    width: 120px;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
}

.login-title {
    color: var(--white);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

/* Queue Display Demo */
.queue-display-demo {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.queue-header {
    text-align: center;
    margin-bottom: 1rem;
}

.queue-label {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.25rem;
}

.queue-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--white);
}

.queue-counters {
    display: flex;
    gap: 0.75rem;
}

.queue-counter {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 1rem 0.75rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.counter-name {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.counter-token {
    display: block;
    color: #34d399;
    font-size: 1.25rem;
    font-weight: 700;
}

/* Features */
.login-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.feature-item i {
    font-size: 1.125rem;
    color: #60a5fa;
    width: 24px;
    text-align: center;
}

/* Right Panel - Form */
.login-right-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    height: 100vh;
    background: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.login-right-panel .col-xs-12,
.login-right-panel .col-xs-6 {
    width: 100%;
    max-width: 380px;
    padding: 0;
    float: none;
}

.login-right-panel form {
    width: 100%;
    max-width: 380px;
}

.login-right-panel::before {
    content: 'Bienvenue';
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.login-right-panel::after {
    content: 'Connectez-vous pour acceder au systeme';
    display: block;
    font-size: 1rem;
    color: var(--gray-500);
    margin-bottom: 2rem;
}

/* Form Inputs */
body.cm-login .form-group {
    margin-bottom: 1.25rem;
}

body.cm-login .input-group {
    border-radius: 8px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    transition: all 0.15s ease;
    overflow: hidden;
}

body.cm-login .input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

body.cm-login .input-group-addon {
    background: var(--gray-50) !important;
    border: none !important;
    border-right: 1px solid var(--gray-200) !important;
    padding: 0.875rem 1rem;
    color: var(--gray-400);
}

body.cm-login .input-group:focus-within .input-group-addon {
    color: var(--primary);
}

body.cm-login .input-group-addon i {
    font-size: 1.125rem;
}

body.cm-login .form-control {
    border: none !important;
    background: transparent !important;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-800);
    height: auto;
    font-family: 'Inter', sans-serif;
}

body.cm-login .form-control::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

/* Login Button */
body.cm-login .btn-primary {
    background: var(--primary) !important;
    border: none !important;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: all 0.15s ease;
    width: 100%;
    margin-top: 0.5rem;
    font-family: 'Inter', sans-serif;
}

body.cm-login .btn-primary:hover {
    background: var(--primary-dark) !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* Error & Alert */
body.cm-login .text-danger {
    color: var(--error) !important;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

body.cm-login .alert {
    border-radius: 8px;
    padding: 0.875rem 1rem;
    font-weight: 500;
    font-size: 0.9rem;
    border: none;
}

body.cm-login .alert-success {
    background: var(--success-light);
    color: var(--success);
}

body.cm-login .alert-danger {
    background: var(--error-light);
    color: var(--error);
}

/* Footer */
body.cm-login .cm-footer {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 50%;
    background: var(--gray-50) !important;
    padding: 1rem 2rem;
    border-top: 1px solid var(--gray-200);
}

body.cm-login .cm-footer span {
    color: var(--gray-500) !important;
    font-size: 0.8125rem;
}

/* Select2 on Login */
body.cm-login .select2-container--default .select2-selection--single {
    border: 1px solid var(--gray-300) !important;
    border-radius: 8px !important;
    height: 48px;
    background: var(--white);
}

body.cm-login .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 46px;
    font-size: 1rem;
    font-weight: 500;
    padding-left: 1rem;
    color: var(--gray-700);
}

/* Demo Table on Login */
body.cm-login table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

body.cm-login table th {
    background: var(--gray-100) !important;
    color: var(--gray-600) !important;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.875rem;
}

body.cm-login table td {
    padding: 0.875rem;
    font-size: 0.9rem;
}

/* Login Responsive */
@media (max-width: 1024px) {
    .login-left-panel { display: none; }
    .login-right-panel { width: 100%; }
    body.cm-login .cm-footer { width: 100%; }
}

/* ==========================================================================
   5. PRINT STYLES
   ========================================================================== */
@media print {
    .no-print { display: none; }

    body.modalprinter * { visibility: hidden; }

    body.modalprinter .modal-dialog.focused .modal-content .modal-body,
    body.modalprinter .modal-dialog.focused .modal-content .modal-body * {
        visibility: visible;
    }
}
