:root {
            /* Variables sincronizadas con el diseño interno del CRM */
            --crm-primary: #00a884;
            --crm-primary-dark: #008069;
            --crm-primary-hover: #028e70;
            --crm-accent: #25d366;
            --crm-danger: #ef4444;
            --crm-warning: #f59e0b;
            --crm-info: #3b82f6;

            --crm-rail-bg: #0f172a;
            --crm-rail-hover: #1e293b;
            --crm-rail-active: #00a884;
            --crm-bg-app: #ffffff;
            --crm-bg-card: #f8fafc;
            --crm-border: #e2e8f0;
            --crm-border-subtle: #edf2f7;

            --crm-text-primary: #0f172a;
            --crm-text-secondary: #64748b;
            --crm-text-muted: #94a3b8;

            --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: var(--font-stack);
        }

        body {
            background-color: var(--crm-rail-bg);
            background-image: 
                radial-gradient(at 0% 0%, rgba(0, 168, 132, 0.15) 0px, transparent 50%),
                radial-gradient(at 100% 100%, rgba(30, 41, 59, 0.8) 0px, transparent 50%),
                radial-gradient(at 50% 50%, rgba(15, 23, 42, 1) 0px, rgba(15, 23, 42, 0.95) 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px 16px;
            color: var(--crm-text-primary);
            position: relative;
            overflow-x: hidden;
        }

        /* Ambient glow de fondo */
        .ambient-glow {
            position: fixed;
            width: 650px;
            height: 650px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(0, 168, 132, 0.12) 0%, rgba(15, 23, 42, 0) 70%);
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            pointer-events: none;
            z-index: 0;
        }

        .login-wrapper {
            position: relative;
            z-index: 1;
            width: 100%;
            max-width: 430px;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .login-card {
            background: #ffffff;
            border-radius: 16px;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.1);
            overflow: hidden;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .login-header {
            background: #f8fafc;
            padding: 28px 24px 22px;
            text-align: center;
            border-bottom: 1px solid var(--crm-border);
            position: relative;
        }

        /* Brand badge idéntico al rail lateral del CRM */
        .brand-badge {
            width: 48px;
            height: 48px;
            border-radius: 14px;
            background: linear-gradient(135deg, #00a884 0%, #008069 100%);
            color: #ffffff;
            font-weight: 700;
            font-size: 18px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 6px 16px rgba(0, 168, 132, 0.35);
            letter-spacing: -0.5px;
            margin-bottom: 14px;
        }

        .login-logo-img {
            max-height: 64px;
            width: auto;
            margin: 0 auto 14px;
            display: block;
            border-radius: 14px;
            box-shadow: 0 4px 16px rgba(0, 168, 132, 0.25);
        }

        .login-title-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-bottom: 6px;
        }

        .login-title {
            font-size: 21px;
            font-weight: 700;
            color: var(--crm-text-primary);
            letter-spacing: -0.4px;
        }

        .login-badge-pill {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            background: rgba(0, 168, 132, 0.12);
            color: var(--crm-primary-dark);
            font-size: 11px;
            font-weight: 600;
            padding: 3px 8px;
            border-radius: 20px;
        }

        .status-dot-pulse {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background-color: #10b981;
            box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
            animation: pulse-green 2s infinite;
        }

        @keyframes pulse-green {
            0% {
                transform: scale(0.95);
                box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
            }
            70% {
                transform: scale(1);
                box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
            }
            100% {
                transform: scale(0.95);
                box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
            }
        }

        .login-subtitle {
            font-size: 13px;
            color: var(--crm-text-secondary);
            line-height: 1.4;
        }

        .login-body {
            padding: 28px 24px;
        }

        /* Alerta de Error estilizada */
        .alert-error {
            background-color: #fef2f2;
            border: 1px solid #fecaca;
            color: #991b1b;
            padding: 12px 14px;
            border-radius: 8px;
            font-size: 13px;
            margin-bottom: 20px;
            display: flex;
            align-items: flex-start;
            gap: 10px;
            line-height: 1.4;
            animation: shake 0.3s ease-in-out;
        }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-4px); }
            75% { transform: translateX(4px); }
        }

        .alert-error svg {
            flex-shrink: 0;
            margin-top: 1px;
            color: #dc2626;
        }

        /* Alerta de Bloqueo por Fuerza Bruta */
        .alert-locked {
            background: #fff5f5;
            border: 1.5px solid #feb2b2;
            border-left: 4px solid #e53e3e;
            border-radius: 10px;
            padding: 16px;
            margin-bottom: 20px;
            box-shadow: 0 4px 14px rgba(229, 62, 62, 0.12);
            animation: shake 0.35s ease-in-out;
        }

        .alert-locked-head {
            display: flex;
            align-items: center;
            gap: 9px;
            color: #9b2c2c;
            font-size: 14px;
            font-weight: 700;
            margin-bottom: 6px;
        }

        .alert-locked-head svg {
            color: #e53e3e;
            flex-shrink: 0;
        }

        .alert-locked-desc {
            font-size: 12.5px;
            color: #742a2a;
            line-height: 1.45;
            margin-bottom: 12px;
        }

        .alert-locked-timer-badge {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            background: #ffffff;
            border: 1px solid #feb2b2;
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 12px;
            color: #9b2c2c;
            font-weight: 600;
        }

        .alert-locked-timer-badge svg {
            color: #e53e3e;
        }

        .input-disabled-lock {
            background-color: #f1f5f9 !important;
            color: #94a3b8 !important;
            cursor: not-allowed !important;
            border-color: #e2e8f0 !important;
        }

        .btn-locked {
            background: #94a3b8 !important;
            cursor: not-allowed !important;
            box-shadow: none !important;
            opacity: 0.8;
            transform: none !important;
        }

        /* Grupos de Formulario idénticos al CRM */
        .form-group {
            margin-bottom: 18px;
        }

        .form-group label {
            display: block;
            font-size: 13px;
            font-weight: 600;
            color: #334155;
            margin-bottom: 6px;
        }

        .input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }

        .input-icon {
            position: absolute;
            left: 13px;
            color: #94a3b8;
            pointer-events: none;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: color 0.2s;
        }

        .form-control {
            width: 100%;
            padding: 11px 14px 11px 40px;
            font-size: 14px;
            color: var(--crm-text-primary);
            border: 1px solid var(--crm-border);
            border-radius: 8px;
            outline: none;
            background: #f8fafc;
            transition: all 0.2s ease;
        }

        .form-control.has-toggle {
            padding-right: 42px;
        }

        .form-control:focus {
            border-color: var(--crm-primary);
            background: #ffffff;
            box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.16);
        }

        .form-control:focus + .input-icon,
        .input-wrapper:focus-within .input-icon {
            color: var(--crm-primary);
        }

        .password-toggle-btn {
            position: absolute;
            right: 12px;
            background: transparent;
            border: none;
            color: #94a3b8;
            cursor: pointer;
            padding: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            transition: color 0.2s;
        }

        .password-toggle-btn:hover {
            color: var(--crm-text-primary);
        }

        /* Botón de Acción Principal CRM */
        .btn-submit {
            width: 100%;
            background: linear-gradient(135deg, #00a884 0%, #008069 100%);
            color: #ffffff;
            border: none;
            padding: 12px 16px;
            font-size: 14px;
            font-weight: 600;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            box-shadow: 0 4px 14px rgba(0, 168, 132, 0.3);
            transition: all 0.2s ease;
            margin-top: 8px;
        }

        .btn-submit:hover {
            background: linear-gradient(135deg, #028e70 0%, #00705a 100%);
            box-shadow: 0 6px 18px rgba(0, 168, 132, 0.4);
            transform: translateY(-1px);
        }

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

        .login-footer {
            padding: 14px 24px;
            background: #f8fafc;
            border-top: 1px solid var(--crm-border);
            text-align: center;
            font-size: 12px;
            color: var(--crm-text-secondary);
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .footer-security {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            font-weight: 500;
            color: #475569;
        }

        .footer-security svg {
            color: var(--crm-primary);
        }

        .login-outer-meta {
            text-align: center;
            font-size: 12px;
            color: #94a3b8;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
        }